diff --git a/modules/PathUtils.js b/modules/PathUtils.js index f911d96001..ac0e479a62 100644 --- a/modules/PathUtils.js +++ b/modules/PathUtils.js @@ -146,7 +146,7 @@ var PathUtils = { if (existingQuery) query = query ? merge(existingQuery, query) : existingQuery; - var queryString = qs.stringify(query, { indices: false }); + var queryString = qs.stringify(query, { arrayFormat: 'brackets' }); if (queryString) return PathUtils.withoutQuery(path) + '?' + queryString; diff --git a/modules/__tests__/PathUtils-test.js b/modules/__tests__/PathUtils-test.js index aadc6d458d..02f6d682d0 100644 --- a/modules/__tests__/PathUtils-test.js +++ b/modules/__tests__/PathUtils-test.js @@ -316,10 +316,10 @@ describe('PathUtils.withQuery', function () { }); it('merges two query strings', function () { - expect(PathUtils.withQuery('/path?a=b', { c: [ 'd', 'e' ] })).toEqual('/path?a=b&c=d&c=e'); + expect(PathUtils.withQuery('/path?a=b', { c: [ 'd', 'e' ] })).toEqual('/path?a=b&c%5B%5D=d&c%5B%5D=e'); }); it('handles special characters', function () { - expect(PathUtils.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'); + expect(PathUtils.withQuery('/path?a=b', { c: [ 'd#e', 'f&a=i#j+k' ] })).toEqual('/path?a=b&c%5B%5D=d%23e&c%5B%5D=f%26a%3Di%23j%2Bk'); }); }); diff --git a/package.json b/package.json index eb2a7010a3..c9b117db2a 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "react": "0.12.x" }, "dependencies": { - "qs": "2.3.3" + "qs": "2.4.1" }, "tags": [ "react",