Skip to content

Commit

Permalink
Merge 2b269cd into 0d84095
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Apr 17, 2020
2 parents 0d84095 + 2b269cd commit a7576e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/source/class/qx/io/request/Xhr.js
Expand Up @@ -241,7 +241,8 @@ qx.Class.define("qx.io.request.Xhr",
// overridden
_getConfiguredRequestHeaders: function() {
var headers = {},
isAllowsBody = qx.util.Request.methodAllowsRequestBody(this.getMethod());
isAllowsBody = qx.util.Request.methodAllowsRequestBody(this.getMethod()),
isFormData = (qx.Bootstrap.getClass(this.getRequestData()) == "FormData");

// Follow convention to include X-Requested-With header when same origin
if (!qx.util.Request.isCrossDomain(this.getUrl())) {
Expand All @@ -254,7 +255,7 @@ qx.Class.define("qx.io.request.Xhr",
}

// By default, set content-type urlencoded for requests with body
if (this.getRequestData() && isAllowsBody) {
if (this.getRequestData() && isAllowsBody && !isFormData) {
headers["Content-Type"] = "application/x-www-form-urlencoded";
}

Expand Down

0 comments on commit a7576e1

Please sign in to comment.