Comparing version 1.8.0 to 1.9.0
12
index.js
@@ -92,5 +92,11 @@ var window = require("global/window") | ||
var status = xhr.statusCode = xhr.status | ||
var body = xhr.body = xhr.response || | ||
xhr.responseText || xhr.responseXML | ||
// Chrome with requestType=blob throws errors arround when even testing access to responseText | ||
var body = null | ||
if (xhr.response) { | ||
body = xhr.body = xhr.response | ||
} else if (xhr.responseType === 'text' || xhr.responseType === '') { | ||
body = xhr.body = xhr.responseText || xhr.responseXML | ||
} | ||
if (status === 1223) { | ||
@@ -101,3 +107,3 @@ status = 204 | ||
if (status === 0 || (status >= 400 && status < 600)) { | ||
var message = xhr.responseText || | ||
var message = (typeof body === "string" ? body : false) || | ||
messages[String(xhr.status).charAt(0)] | ||
@@ -104,0 +110,0 @@ error = new Error(message) |
{ | ||
"name": "xhr", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"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
9457
121