diff --git a/lib/helpers/toFormData.js b/lib/helpers/toFormData.js index 327a979284..a41e966c03 100644 --- a/lib/helpers/toFormData.js +++ b/lib/helpers/toFormData.js @@ -152,7 +152,7 @@ function toFormData(obj, formData, options) { value = JSON.stringify(value); } else if ( (utils.isArray(value) && isFlatArray(value)) || - (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value)) + ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) )) { // eslint-disable-next-line no-param-reassign key = removeBrackets(key);