Skip to content

Commit 8a8c534

Browse files
Fixing special char encoding (axios#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 <[email protected]>
1 parent 5effc08 commit 8a8c534

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/helpers/buildURL.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var utils = require('./../utils');
44

55
function encode(val) {
66
return encodeURIComponent(val).
7-
replace(/%40/gi, '@').
87
replace(/%3A/gi, ':').
98
replace(/%24/g, '$').
109
replace(/%2C/gi, ',').

test/specs/helpers/buildURL.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ describe('helpers::buildURL', function () {
3636

3737
it('should support special char params', function () {
3838
expect(buildURL('/foo', {
39-
foo: '@:$, '
40-
})).toEqual('/foo?foo=@:$,+');
39+
foo: ':$, '
40+
})).toEqual('/foo?foo=:$,+');
4141
});
4242

4343
it('should support existing params', function () {

0 commit comments

Comments
 (0)