зеркало из https://github.com/Azure/ms-rest-js.git
Fix browser FormData test
This commit is contained in:
Родитель
454ab53fc7
Коммит
64b95edfbb
|
@ -49,8 +49,13 @@ export class FetchHttpClient implements HttpClient {
|
|||
httpRequest.body = requestForm;
|
||||
httpRequest.formData = undefined;
|
||||
if (httpRequest.headers && httpRequest.headers["Content-Type"] &&
|
||||
httpRequest.headers["Content-Type"].indexOf("multipart/form-data") > -1 && typeof requestForm.getBoundary === "function") {
|
||||
httpRequest.headers["Content-Type"] = `multipart/form-data; boundary=${requestForm.getBoundary()}`;
|
||||
httpRequest.headers["Content-Type"].indexOf("multipart/form-data") !== -1) {
|
||||
if (typeof requestForm.getBoundary === "function") {
|
||||
httpRequest.headers["Content-Type"] = `multipart/form-data; boundary=${requestForm.getBoundary()}`;
|
||||
} else {
|
||||
// browser will automatically apply a suitable content-type header
|
||||
delete httpRequest.headers["Content-Type"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче