Repository navigation
Commit 8d09bfe
fix: restore array parsing for req.query repeated keys (#7181)
fix: restore array parsing for `req.query` repeated keys (#7147)
The default `req.query` extended query parser now sets `arrayLimit: 1000` to restore prior array parsing behavior.
qs 6.14.1 began enforcing `arrayLimit` for bracket notation (`a[]=1&a[]=2&...`) and repeated-key notation (`a=1&a=2&...`), where it had previously been silently ignored. Express has never set `arrayLimit` explicitly, so once 4.22.0 picked up qs `~6.14.0`, the default `arrayLimit` of 20 began taking effect — `req.query.a` for arrays larger than 20 items was returned as an object with integer keys (`{ '0': ..., '1': ... }`) instead of an array.
Prior to qs 6.14.1, the effective ceiling for these notations was qs's default `parameterLimit` of 1000 (also not set by Express). This release passes `arrayLimit: 1000` to keep that practical ceiling, restoring the pre-4.22.0 behavior.
Note: this also unifies array-cap behavior across notations. Indexed notation (`a[0]=...`) was historically capped at qs's default `arrayLimit` of 20 even in older qs versions; after this change it also allows up to 1000 items.
---------
Co-authored-by: Jon Church <me@jonchurch.com>1 parent d39e8ad commit 8d09bfe
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
41 | 55 | | |
42 | 56 | | |
43 | 57 | | |
| |||
0 commit comments