From 91d43a63af04ac9f124cd4a373a4eadd7700c41b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 18 Jun 2020 19:39:44 +0200 Subject: [PATCH] remove content-type for form_data. browser will automatically set it NO_CI --- Message/Request/Request.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Message/Request/Request.js b/Message/Request/Request.js index 0247696..e3dd64e 100644 --- a/Message/Request/Request.js +++ b/Message/Request/Request.js @@ -34,6 +34,9 @@ export class Request this.data = {}; this.requestHeader['Content-Type'] = this.setContentTypeBasedOnType(this.type); + if (this.type === RequestType.FORM_DATA) { + delete this.requestHeader['Content-Type'] + } this.result[0] = function(xhr) { @@ -304,6 +307,10 @@ export class Request { this.type = type; this.requestHeader['Content-Type'] = this.setContentTypeBasedOnType(this.type); + + if (this.type === RequestType.FORM_DATA) { + delete this.requestHeader['Content-Type'] + } }; /**