Only allow basic auth credentials with a known appId (#2574)
* Only allow basic auth credentials with a known appId * Update middlewares.js * Updating basic auth tests to use valid appId
This commit is contained in:
@@ -31,9 +31,12 @@ export function handleParseHeaders(req, res, next) {
|
||||
var basicAuth = httpAuth(req);
|
||||
|
||||
if (basicAuth) {
|
||||
info.appId = basicAuth.appId
|
||||
info.masterKey = basicAuth.masterKey || info.masterKey;
|
||||
info.javascriptKey = basicAuth.javascriptKey || info.javascriptKey;
|
||||
var basicAuthAppId = basicAuth.appId;
|
||||
if (AppCache.get(basicAuthAppId)) {
|
||||
info.appId = basicAuthAppId;
|
||||
info.masterKey = basicAuth.masterKey || info.masterKey;
|
||||
info.javascriptKey = basicAuth.javascriptKey || info.javascriptKey;
|
||||
}
|
||||
}
|
||||
|
||||
if (req.body) {
|
||||
|
||||
Reference in New Issue
Block a user