We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d4dc40 commit d33884eCopy full SHA for d33884e
src/Formidable.js
@@ -142,7 +142,9 @@ class IncomingForm extends EventEmitter {
142
const files = {};
143
144
this.on('field', (name, value) => {
145
- if (this.options.multiples) {
+ if (this.options.multiples &&
146
+ (this.type === 'multipart' || this.type === 'urlencoded')
147
+ ) {
148
const mObj = { [name]: value };
149
mockFields = `${mockFields}&${qs.stringify(mObj)}`;
150
} else {
test/integration/test-json.js
@@ -11,7 +11,7 @@ const testData = {
11
12
const PORT = 13532;
13
const server = http.createServer((req, res) => {
14
- const form = formidable();
+ const form = formidable({multiples: true});
15
16
form.parse(req, (err, fields) => {
17
assert.deepStrictEqual(fields, {
0 commit comments