Socket
Socket
Sign inDemoInstall

stream-http

Package Overview
Dependencies
Maintainers
1
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 1.2.1 to 1.3.0

test/browser/cookie.js

3

index.js

@@ -28,5 +28,2 @@ var ClientRequest = require('./lib/request')

if (opts.withCredentials === undefined)
opts.withCredentials = true
// Also valid opts.auth, opts.mode

@@ -33,0 +30,0 @@

@@ -122,3 +122,3 @@ // var Base64 = require('Base64')

mode: 'cors',
credentials: opts.withCredentials ? 'include' : 'omit'
credentials: opts.withCredentials ? 'include' : 'same-origin'
}).then(function (response) {

@@ -125,0 +125,0 @@ self._fetchResponse = response

{
"name": "stream-http",
"version": "1.2.1",
"version": "1.3.0",
"description": "Streaming http in the browser",

@@ -18,2 +18,9 @@ "main": "index.js",

"license": "MIT",
"keywords": [
"http",
"stream",
"streaming",
"xhr",
"http-browserify"
],
"dependencies": {

@@ -30,2 +37,3 @@ "builtin-status-codes": "~1.0.0",

"brfs": "^1.4.0",
"cookie-parser": "^1.3.5",
"express": "^4.13.0",

@@ -32,0 +40,0 @@ "tape": "^4.0.0",

@@ -88,3 +88,3 @@ // These tests are teken from http-browserify to ensure compatibility with

var request = http.get({ url: url }, noop)
t.equal( request._xhr.withCredentials, true, 'xhr.withCredentials should be true')
t.equal( request._xhr.withCredentials, false, 'xhr.withCredentials should be false')

@@ -91,0 +91,0 @@ t.end()

@@ -0,1 +1,2 @@

var cookieParser = require('cookie-parser')
var basicAuth = require('basic-auth')

@@ -49,2 +50,8 @@ var express = require('express')

app.get('/cookie', cookieParser(), function (req, res) {
res.setHeader('Content-Type', 'text/plain')
res.write('hello=' + req.cookies.hello)
res.end()
})
app.get('/auth', function (req, res) {

@@ -51,0 +58,0 @@ var user = basicAuth(req)

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