diff --git a/server/util-server.js b/server/util-server.js index ecdcef076..2a47fa45d 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -372,8 +372,7 @@ exports.constructAuthorizedRequest = function (request, username, userPassword = nonce: proxyAuthenticateHeader.nonce.replace(/"/g, ""), }; // Construct Digest authentication header manually - userPassword = passwordHash.generate(userPassword); - const ha1 = crypto.createHash("sha256").update(`${username}:${digestChallenge.realm}:${userPassword}`).digest("hex"); + const ha1 = crypto.createHash("sha256").update(`${username}:${digestChallenge.realm}:${passwordHash.generate(userPassword)}`).digest("hex"); const ha2 = crypto.createHash("sha256").update(`${request.method}:${request.uri}`).digest("hex"); const response = crypto.createHash("sha256").update(`${ha1}:${digestChallenge.nonce}:${ha2}`).digest("hex"); const authorizationHeader = `Digest username="${username}", realm="${digestChallenge.realm}", nonce="${digestChallenge.nonce}", uri="${request.uri}", response="${response}"`;