From 27470758e7b26cd4ae8b1beaebd0bb8092d7d321 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 18 Jun 2020 20:37:00 +0200 Subject: [PATCH] delete header in some special cases --- Message/Request/Request.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Message/Request/Request.js b/Message/Request/Request.js index e3dd64e..6bc8100 100644 --- a/Message/Request/Request.js +++ b/Message/Request/Request.js @@ -35,7 +35,7 @@ export class Request this.requestHeader['Content-Type'] = this.setContentTypeBasedOnType(this.type); if (this.type === RequestType.FORM_DATA) { - delete this.requestHeader['Content-Type'] + delete this.requestHeader['Content-Type']; } this.result[0] = function(xhr) @@ -197,6 +197,10 @@ export class Request setRequestHeader(type, header) { this.requestHeader[type] = header; + + if (header === 'multipart/form-data') { + delete this.requestHeader[type]; + } }; /** @@ -309,7 +313,7 @@ export class Request this.requestHeader['Content-Type'] = this.setContentTypeBasedOnType(this.type); if (this.type === RequestType.FORM_DATA) { - delete this.requestHeader['Content-Type'] + delete this.requestHeader['Content-Type']; } };