Skip to content

Commit 2ca8f2c

Browse files
authored
add form.multiples check
preserves backward compat related to #380 #340
1 parent cfe3d83 commit 2ca8f2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/incoming_form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ IncomingForm.prototype.parse = function(req, cb) {
8484
var fields = {}, files = {};
8585
this
8686
.on('field', function(name, value) {
87-
if (name.slice(-2) === '[]') {
87+
if (this.multiples && name.slice(-2) === '[]') {
8888
var realName = name.slice(0, name.length - 2);
8989
if (realName in fields) {
9090
if (!Array.isArray(fields[realName])) {

0 commit comments

Comments
 (0)