Skip to content

Commit 3457bad

Browse files
committed
Merge pull request #805 from gaearon/fix-special-characters-in-query
[fixed] Allow special characters in query
2 parents c8a29a6 + 83c8f59 commit 3457bad

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

modules/utils/Path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ var Path = {
133133
var queryString = qs.stringify(query, { indices: false });
134134

135135
if (queryString)
136-
return Path.withoutQuery(path) + '?' + decodeURIComponent(queryString);
136+
return Path.withoutQuery(path) + '?' + queryString;
137137

138138
return path;
139139
},

modules/utils/__tests__/Path-test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,8 @@ describe('Path.withQuery', function () {
318318
it('merges two query strings', function () {
319319
expect(Path.withQuery('/path?a=b', { c: [ 'd', 'e' ] })).toEqual('/path?a=b&c=d&c=e');
320320
});
321+
322+
it('handles special characters', function () {
323+
expect(Path.withQuery('/path?a=b', { c: [ 'd#e', 'f&a=i#j+k' ] })).toEqual('/path?a=b&c=d%23e&c=f%26a%3Di%23j%2Bk');
324+
});
321325
});

0 commit comments

Comments
 (0)