Socket
Socket
Sign inDemoInstall

request

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request - npm Package Compare versions

Comparing version 2.20.0 to 2.21.0

7

index.js

@@ -306,3 +306,3 @@ // Copyright 2010-2012 Mikeal Rogers

self.auth(
options.auth.user || options.auth.username,
(options.auth.user==="") ? options.auth.user : (options.auth.user || options.auth.username ),
options.auth.pass || options.auth.password,

@@ -314,3 +314,3 @@ options.auth.sendImmediately)

var authPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) })
self.auth(authPieces[0], authPieces[1], true)
self.auth(authPieces[0], authPieces.slice(1).join(':'), true)
}

@@ -796,2 +796,5 @@ if (self.proxy && self.proxy.auth && !self.headers['proxy-authorization'] && !self.tunnel) {

}
self.emit('redirect');
self.init()

@@ -798,0 +801,0 @@ return // Ignore the rest of the response

@@ -10,3 +10,3 @@ {

],
"version": "2.20.0",
"version": "2.21.0",
"author": "Mikeal Rogers <mikeal.rogers@gmail.com>",

@@ -25,14 +25,14 @@ "repository": {

"dependencies": {
"form-data": "~0.0.3",
"mime": "~1.2.7",
"hawk": "~0.10.2",
"node-uuid": "~1.4.0",
"cookie-jar": "~0.3.0",
"qs": "~0.6.0",
"json-stringify-safe": "~4.0.0",
"forever-agent": "~0.5.0",
"tunnel-agent": "~0.3.0",
"http-signature": "~0.9.11",
"hawk": "~0.13.0",
"aws-sign": "~0.3.0",
"oauth-sign": "~0.3.0",
"http-signature": "~0.9.1",
"forever-agent": "~0.3.0",
"tunnel-agent": "~0.3.0",
"json-stringify-safe": "~3.0.0",
"qs": "~0.5.4"
"cookie-jar": "~0.3.0",
"node-uuid": "~1.4.0",
"mime": "~1.2.9",
"form-data": "0.0.8"
},

@@ -39,0 +39,0 @@ "scripts": {

@@ -17,2 +17,4 @@ var assert = require('assert')

ok = true;
} else if ( req.headers.authorization == 'Basic ' + new Buffer(':apassword').toString('base64')) {
ok = true;
} else {

@@ -110,2 +112,20 @@ // Bad auth header, don't send back WWW-Authenticate header

});
},
function(next) {
assert.doesNotThrow( function() {
request({
'method': 'GET',
'uri': 'http://localhost:6767/allow_empty_user/',
'auth': {
'user': '',
'pass': 'apassword',
'sendImmediately': false
}
}, function(error, res, body ) {
assert.equal(res.statusCode, 200);
assert.equal(numBasicRequests, 8);
next();
});
})
}

@@ -112,0 +132,0 @@ ];

@@ -1,9 +0,15 @@

var request = request = require('../index')
var request = require('../index')
, assert = require('assert')
;
request.get({
uri: 'http://www.google.com', localAddress: '1.2.3.4' // some invalid address
}, function(err, res) {
assert(!res) // asserting that no response received
})
request.get({
uri: 'http://www.google.com', localAddress: '127.0.0.1'
}, function(err) {
assert.equal(err.code, 'ENETUNREACH')
}, function(err, res) {
assert(!res) // asserting that no response received
})
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