Skip to content

Commit 5064b10

Browse files
authored
fix(form-data): convert boolean values to strings in FormData serialization (#6917)
1 parent c7e0fea commit 5064b10

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/helpers/toFormData.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ function toFormData(obj, formData, options) {
120120
return value.toISOString();
121121
}
122122

123+
if (utils.isBoolean(value)) {
124+
return value.toString();
125+
}
126+
123127
if (!useBlob && utils.isBlob(value)) {
124128
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
125129
}

0 commit comments

Comments
 (0)