Comparing version 2.0.3 to 2.0.4
16
index.js
@@ -45,3 +45,3 @@ "use strict"; | ||
} | ||
var failureResponse = { | ||
@@ -55,3 +55,3 @@ body: undefined, | ||
} | ||
function errorFunc(evt) { | ||
@@ -79,3 +79,3 @@ clearTimeout(timeoutTimer) | ||
var err = null | ||
if (status !== 0){ | ||
@@ -97,5 +97,5 @@ response = { | ||
callback(err, response, response.body) | ||
} | ||
if (typeof options === "string") { | ||
@@ -135,3 +135,3 @@ options = { uri: options } | ||
if (method !== "GET" && method !== "HEAD") { | ||
headers["Content-Type"] = "application/json" | ||
headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json") //Don't override existing accept header declared by user | ||
body = JSON.stringify(options.json) | ||
@@ -178,4 +178,4 @@ } | ||
} | ||
if ("beforeSend" in options && | ||
if ("beforeSend" in options && | ||
typeof options.beforeSend === "function" | ||
@@ -182,0 +182,0 @@ ) { |
{ | ||
"name": "xhr", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "small xhr abstraction", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18335