From 08104c028c0f9353897b1b6691d74c440fd0c32d Mon Sep 17 00:00:00 2001 From: Dmitriy Mozgovoy Date: Wed, 1 Feb 2023 20:38:59 +0200 Subject: [PATCH] fix(serializer): fixed serialization of array-like objects; (#5518) --- lib/helpers/toFormData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);