From 6a4285e9a3479132c64a456c56b45664fb00786c Mon Sep 17 00:00:00 2001 From: tspecht Date: Thu, 22 Feb 2018 18:42:38 -0500 Subject: [PATCH 1/2] Update graphql.js --- graphql.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphql.js b/graphql.js index d45727b..ba7f5fc 100644 --- a/graphql.js +++ b/graphql.js @@ -45,6 +45,7 @@ xhr.open(method, url, true) xhr.setRequestHeader('Content-Type', (asJson ? 'application/json' : 'application/x-www-form-urlencoded')) xhr.setRequestHeader('Accept', 'application/json') + xhr.setRequestHeader('Content-Length', 'application/json') for (var key in headers) { xhr.setRequestHeader(key, headers[key]) } xhr.onerror = function () { callback(xhr, xhr.status) } xhr.onload = function () { @@ -66,6 +67,7 @@ method: "POST", headers: __extend({ 'Content-type': (asJson ? 'application/json' : 'application/x-www-form-urlencoded'), + 'Content-Length': body.length, 'Accept': 'application/json' }, headers) }, function (response) { @@ -277,7 +279,7 @@ __request(that.options.method || "post", that.getUrl(), headers, { query: fragmentedQuery, variables: that.cleanAutoDeclareAnnotations(variables) - }, !!that.options.asJSON, that.options.onRequestError, function (response, status) { + }, !!that.options.asJson, that.options.onRequestError, function (response, status) { if (status == 200) { if (response.errors) { reject(response.errors) From 6c0c155757d09486423ef830a6ea94a4ea763556 Mon Sep 17 00:00:00 2001 From: tspecht Date: Thu, 22 Feb 2018 18:46:22 -0500 Subject: [PATCH 2/2] Update graphql.js --- graphql.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql.js b/graphql.js index ba7f5fc..697d233 100644 --- a/graphql.js +++ b/graphql.js @@ -45,7 +45,7 @@ xhr.open(method, url, true) xhr.setRequestHeader('Content-Type', (asJson ? 'application/json' : 'application/x-www-form-urlencoded')) xhr.setRequestHeader('Accept', 'application/json') - xhr.setRequestHeader('Content-Length', 'application/json') + xhr.setRequestHeader('Content-Length', body.length) for (var key in headers) { xhr.setRequestHeader(key, headers[key]) } xhr.onerror = function () { callback(xhr, xhr.status) } xhr.onload = function () {