From 8a8c534a609cefb10824dec2f6a4b3ca1aa99171 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 27 May 2020 05:37:39 -0700 Subject: [PATCH] Fixing special char encoding (#1671) * removing @ character from replacement list since it is a reserved character * Updating buildURL test to not include the @ character * Removing console logs Co-authored-by: Jay --- lib/helpers/buildURL.js | 1 - test/specs/helpers/buildURL.spec.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/helpers/buildURL.js b/lib/helpers/buildURL.js index 8c40e40..31595c3 100644 --- a/lib/helpers/buildURL.js +++ b/lib/helpers/buildURL.js @@ -4,7 +4,6 @@ var utils = require('./../utils'); function encode(val) { return encodeURIComponent(val). - replace(/%40/gi, '@'). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). diff --git a/test/specs/helpers/buildURL.spec.js b/test/specs/helpers/buildURL.spec.js index b819f9d..7adf574 100644 --- a/test/specs/helpers/buildURL.spec.js +++ b/test/specs/helpers/buildURL.spec.js @@ -36,8 +36,8 @@ describe('helpers::buildURL', function () { it('should support special char params', function () { expect(buildURL('/foo', { - foo: '@:$, ' - })).toEqual('/foo?foo=@:$,+'); + foo: ':$, ' + })).toEqual('/foo?foo=:$,+'); }); it('should support existing params', function () {