Socket
Socket
Sign inDemoInstall

stream-http

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-http - npm Package Compare versions

Comparing version 2.7.1 to 2.7.2

4

package.json
{
"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()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc