Commit 0d41c2f
committed
fix: use indexed bracket notation for multipart array encoding
Changes array encoding in addFormValue from `key + '[]'` to
`key + '[' + i + ']'` so that arrays of objects produce indexed field
names (e.g. files[0][dest_path]) instead of ambiguous empty-bracket
names (e.g. files[][dest_path]).
Without indices, the server cannot parse the field names
(strconv.Atoi("") fails on the empty string between []) and cannot
pair file contents with destination paths for multi-file uploads.
Updates the existing form.test.ts assertion to expect the correct
indexed format (bar[1] instead of bar[]).
Made-with: Cursor1 parent bb29258 commit 0d41c2f
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
0 commit comments