Skip to content

Commit

Permalink
Merge pull request #805 from gaearon/fix-special-characters-in-query
Browse files Browse the repository at this point in the history
[fixed] Allow special characters in query
  • Loading branch information
mjackson committed Feb 17, 2015
2 parents c8a29a6 + 83c8f59 commit 3457bad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/utils/Path.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var Path = {
var queryString = qs.stringify(query, { indices: false });

if (queryString)
return Path.withoutQuery(path) + '?' + decodeURIComponent(queryString);
return Path.withoutQuery(path) + '?' + queryString;

return path;
},
Expand Down
4 changes: 4 additions & 0 deletions modules/utils/__tests__/Path-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,8 @@ describe('Path.withQuery', function () {
it('merges two query strings', function () {
expect(Path.withQuery('/path?a=b', { c: [ 'd', 'e' ] })).toEqual('/path?a=b&c=d&c=e');
});

it('handles special characters', function () {
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');
});
});

0 comments on commit 3457bad

Please sign in to comment.