1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add quotation marks for basic auth challenge

This is required by RFC 2617
This commit is contained in:
Matthias Uttendorfer 2018-11-13 23:05:19 +01:00
parent c685a31056
commit e094ea3d2a

2
red.js
View File

@ -240,7 +240,7 @@ function basicAuthMiddleware(user,pass) {
} }
var requestUser = basicAuth(req); var requestUser = basicAuth(req);
if (!requestUser || requestUser.name !== user || !checkPasswordAndCache(requestUser.pass)) { if (!requestUser || requestUser.name !== user || !checkPasswordAndCache(requestUser.pass)) {
res.set('WWW-Authenticate', 'Basic realm=Authorization Required'); res.set('WWW-Authenticate', 'Basic realm="Authorization Required"');
return res.sendStatus(401); return res.sendStatus(401);
} }
next(); next();