Guard against URI encoding

This commit is contained in:
Michael Lange
2018-07-09 19:03:08 -07:00
parent da49c51656
commit a82a036a12

View File

@@ -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() {