Fixed FormData content type.

This commit is contained in:
flash 2024-01-24 19:54:53 +00:00
parent 52b45884d5
commit 1c813ad97c

View file

@ -208,7 +208,7 @@ const $x = (function() {
if(body instanceof URLSearchParams) {
requestHeaders.set('content-type', 'application/x-www-form-urlencoded');
} else if(body instanceof FormData) {
requestHeaders.set('content-type', 'multipart/form-data');
// content-type is implicitly set
} else if(body instanceof Blob || body instanceof ArrayBuffer || body instanceof DataView) {
if(!requestHeaders.has('content-type'))
requestHeaders.set('content-type', 'application/octet-stream');