Comparing version 0.4.3 to 0.4.4
@@ -170,3 +170,11 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
pieces = decoded !== null ? decoded.split(':', 2) : null; | ||
if (decoded !== null) { | ||
var idx = decoded.indexOf(':'); | ||
if (idx === -1) { | ||
pieces = [decoded]; | ||
} else { | ||
pieces = [decoded.slice(0, idx), decoded.slice(idx + 1)]; | ||
} | ||
} | ||
if (!(pieces !== null ? pieces[0] : null) || | ||
@@ -173,0 +181,0 @@ !(pieces !== null ? pieces[1] : null)) { |
{ | ||
"name": "restify", | ||
"description": "REST framework specifically meant for web service APIs", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -17,2 +17,3 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
var password = uuid(); | ||
var trickyPassword = 'pass:word'; | ||
@@ -32,3 +33,4 @@ | ||
req.authorization.basic.username !== username || | ||
req.authorization.basic.password !== password) { | ||
(req.authorization.basic.password !== password && | ||
req.authorization.basic.password !== trickyPassword)) { | ||
res.send(401); | ||
@@ -63,3 +65,15 @@ } | ||
exports.test_tricky_password = function(test, assert) { | ||
var opts = common.newOptions(socket, '/test/unit'); | ||
opts.method = 'GET'; | ||
opts.headers.authorization = 'Basic ' + | ||
new Buffer(username + ':' + 'pass:word', 'utf8').toString('base64'); | ||
http.request(opts, function(res) { | ||
common.checkResponse(assert, res); | ||
assert.equal(res.statusCode, 200); | ||
test.finish(); | ||
}).end(); | ||
}; | ||
exports.test_no_auth = function(test, assert) { | ||
@@ -116,3 +130,2 @@ var opts = common.newOptions(socket, '/test/unit'); | ||
exports.tearDown = function(test, assert) { | ||
@@ -119,0 +132,0 @@ server.on('close', function() { |
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
224436
4261