From a82a036a129c942e4a386bafd4ed7e871c19d7d2 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Mon, 9 Jul 2018 19:03:08 -0700 Subject: [PATCH] Guard against URI encoding --- ui/app/components/server-agent-row.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/app/components/server-agent-row.js b/ui/app/components/server-agent-row.js index 98d401fe0..fb4b72c49 100644 --- a/ui/app/components/server-agent-row.js +++ b/ui/app/components/server-agent-row.js @@ -24,11 +24,12 @@ export default Component.extend({ const router = this.get('router'); const targetURL = router.generate('servers.server', this.get('agent')); - const currentURL = `${router.get('rootURL').slice(0, -1)}${router - .get('currentURL') - .split('?')[0]}`; + const currentURL = `${router.get('rootURL').slice(0, -1)}${ + router.get('currentURL').split('?')[0] + }`; - return currentURL === targetURL; + // Account for potential URI encoding + return currentURL.replace(/%40/g, '@') === targetURL.replace(/%40/g, '@'); }), click() {