From 43e1af93c1a478719dd77458458f5db5f8e56005 Mon Sep 17 00:00:00 2001 From: vileda Date: Tue, 10 Sep 2013 15:58:39 +0200 Subject: [PATCH] allow users to have colons in password --- src/node/hooks/express/webaccess.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/hooks/express/webaccess.js b/src/node/hooks/express/webaccess.js index 944fd98f7..efced3f76 100644 --- a/src/node/hooks/express/webaccess.js +++ b/src/node/hooks/express/webaccess.js @@ -32,8 +32,8 @@ exports.basicAuth = function (req, res, next) { // If auth headers are present use them to authenticate... if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) { var userpass = new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString().split(":") - var username = userpass[0]; - var password = userpass[1]; + var username = userpass.shift(); + var password = userpass.join(':'); if (settings.users[username] != undefined && settings.users[username].password == password) { settings.users[username].username = username;