stream-http
Advanced tools
Comparing version 2.7.1 to 2.7.2
{ | ||
"name": "stream-http", | ||
"version": "2.7.1", | ||
"version": "2.7.2", | ||
"description": "Streaming http in the browser", | ||
@@ -39,3 +39,3 @@ "main": "index.js", | ||
"brfs": "^1.4.0", | ||
"cookie-parser": "^1.3.5", | ||
"cookie-parser": "^1.4.3", | ||
"express": "^4.15.2", | ||
@@ -42,0 +42,0 @@ "tape": "^4.0.0", |
@@ -96,2 +96,3 @@ var Buffer = require('buffer').Buffer | ||
// is passed in browsers that rely on xhr.overrideMimeType(), namely older chrome, safari 6-10.0, and the stock Android browser | ||
// Note that Safari 10.0 on iOS 10.3 doesn't need to override the mime type, so the content-type is preserved. | ||
var wrongMimeType = ((browserName === 'Chrome' && browserVersion <= 42) || | ||
@@ -106,5 +107,9 @@ ((browserName === 'Safari' || browserName === 'Mobile Safari') && browserVersion >= 6 && (browserVersion < 10 || (browserVersion == 10 && browserMinorVersion == 0))) | ||
}, function (res) { | ||
if (wrongMimeType) | ||
t.equal(res.headers['content-type'], 'text/plain; charset=x-user-defined', 'content-type overridden') | ||
else | ||
if (wrongMimeType) { | ||
// allow both the 'wrong' and correct mime type, since sometimes it's impossible to tell which to expect | ||
// from the browser version alone (e.g. Safari 10.0 on iOS 10.2 vs iOS 10.3) | ||
var contentType = res.headers['content-type'] | ||
var correct = (contentType === 'text/plain; charset=x-user-defined') || (contentType === 'application/json') | ||
t.ok(correct, 'content-type either preserved or overridden') | ||
} else | ||
t.equal(res.headers['content-type'], 'application/json', 'content-type preserved') | ||
@@ -111,0 +116,0 @@ t.end() |
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
88096
1426