Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ function createETagGenerator (options) {

function parseExtendedQueryString(str) {
return qs.parse(str, {
allowPrototypes: true
allowPrototypes: true,
arrayLimit: 1000
Comment thread
jonchurch marked this conversation as resolved.
});
}

Expand Down
14 changes: 14 additions & 0 deletions test/req.query.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ describe('req', function(){
.get('/?user.name=tj')
.expect(200, '{"user.name":"tj"}', done);
});

it('should parse more than 20 repeated values as an array', function (done) {
var app = createApp('extended');
var ids = [];
var expected = [];
for (var i = 0; i < 25; i++) {
ids.push('ids=' + i);
expected.push(String(i));
}

request(app)
.get('/?' + ids.join('&'))
.expect(200, JSON.stringify({ ids: expected }), done);
});
});

describe('when "query parser" is simple', function () {
Expand Down
Loading