File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,12 @@ jsonApi.setConfig({
3131 // such as the maximum allowed body size (default is 100kb). All the options are
3232 // documented at https://github.com/expressjs/body-parser#bodyparserjsonoptions
3333 bodyParserJsonOpts: {
34- limit: ' 256kb' ,
35- }
34+ limit: ' 256kb'
35+ },
36+ // (optional) queryStringParsingParameterLimit allows to
37+ // override the default limit of 1000 parameters in query string parsing,
38+ // documented at : https://github.com/ljharb/qs
39+ queryStringParsingParameterLimit: Infinity
3640});
3741```
3842
Original file line number Diff line number Diff line change @@ -15,13 +15,15 @@ rerouter.route = (newRequest, callback) => {
1515
1616 const path = rerouter . _generateSanePath ( newRequest )
1717 const route = rerouter . _pickFirstMatchingRoute ( validRoutes , path )
18-
18+ const qsOpts = jsonApi . _apiConfig . queryStringParsingParameterLimit
19+ ? { parameterLimit : jsonApi . _apiConfig . queryStringParsingParameterLimit }
20+ : { }
1921 const req = {
2022 url : newRequest . uri ,
2123 originalUrl : newRequest . originalRequest . originalUrl ,
2224 headers : newRequest . originalRequest . headers ,
2325 cookies : newRequest . originalRequest . cookies ,
24- params : rerouter . _mergeParams ( url . parse ( newRequest . uri . split ( '?' ) [ 1 ] || { } ) , newRequest . params )
26+ params : rerouter . _mergeParams ( url . parse ( newRequest . uri . split ( '?' ) [ 1 ] || { } , qsOpts ) , newRequest . params )
2527 }
2628 rerouter . _extendUrlParamsOntoReq ( route , path , req )
2729
You can’t perform that action at this time.
0 commit comments