Skip to content

Commit 60f9eb4

Browse files
committed
[fixed] encoded ampersands in query params
fixes #343
1 parent acc00f7 commit 60f9eb4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

modules/utils/Path.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ var Path = {
112112
* in the given path, null if the path contains no query string.
113113
*/
114114
extractQuery: function (path) {
115-
var match = decodeURL(path).match(queryMatcher);
115+
var match = path.match(queryMatcher);
116116
return match && qs.parse(match[1]);
117117
},
118118

modules/utils/__tests__/Path-test.js

+4
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ describe('Path.extractQuery', function () {
229229
it('properly handles arrays', function () {
230230
expect(Path.extractQuery('/?id%5B%5D=a&id%5B%5D=b')).toEqual({ id: [ 'a', 'b' ] });
231231
});
232+
233+
it('properly handles encoded ampersands', function () {
234+
expect(Path.extractQuery('/?id=a%26b')).toEqual({ id: 'a&b' });
235+
});
232236
});
233237

234238
describe('when the path does not contain a query string', function () {

0 commit comments

Comments
 (0)