Comparing version 2.20.0 to 2.21.0
@@ -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 | ||
}) |
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
198569
3222
+ Addedboom@0.4.2(transitive)
+ Addedcryptiles@0.2.2(transitive)
+ Addedforever-agent@0.5.2(transitive)
+ Addedform-data@0.0.8(transitive)
+ Addedhawk@0.13.1(transitive)
+ Addedhoek@0.8.50.9.1(transitive)
+ Addedjson-stringify-safe@4.0.0(transitive)
+ Addedqs@0.6.6(transitive)
+ Addedsntp@0.2.4(transitive)
- Removedboom@0.3.8(transitive)
- Removedcryptiles@0.1.3(transitive)
- Removedforever-agent@0.3.0(transitive)
- Removedform-data@0.0.10(transitive)
- Removedhawk@0.10.2(transitive)
- Removedhoek@0.7.6(transitive)
- Removedjson-stringify-safe@3.0.0(transitive)
- Removedqs@0.5.6(transitive)
- Removedsntp@0.1.4(transitive)
Updatedforever-agent@~0.5.0
Updatedform-data@0.0.8
Updatedhawk@~0.13.0
Updatedhttp-signature@~0.9.11
Updatedjson-stringify-safe@~4.0.0
Updatedmime@~1.2.9
Updatedqs@~0.6.0