Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
httpServer.authenticate = function (req, fn) {
// parse the "Proxy-Authorization" header
const auth = req.headers['proxy-authorization'];
if (!auth) {
// optimization: don't invoke the child process if no
// "Proxy-Authorization" header was given
// console.log('not Proxy-Authorization');
return fn(null, false);
}
const parsed = basicAuthParser(auth);
const isEqual = _.isEqual(parsed, proxyAuth);
// console.log('Parsed "Proxy-Authorization": parsed: %j expected: %j : %s', parsed, proxyAuth, isEqual);
if (isEqual) wasProxyCalled = true;
fn(null, isEqual);
};
httpServer.authenticate = function (req, fn) {
// parse the "Proxy-Authorization" header
const auth = req.headers['proxy-authorization'];
if (!auth) {
// optimization: don't invoke the child process if no
// "Proxy-Authorization" header was given
// console.log('not Proxy-Authorization');
return fn(null, false);
}
const parsed = basicAuthParser(auth);
const isEqual = _.isEqual(parsed, proxyAuth);
// console.log('Parsed "Proxy-Authorization": parsed: %j expected: %j : %s', parsed, proxyAuth, isEqual);
if (isEqual) wasProxyCalled = true;
fn(null, isEqual);
};
httpServer.authenticate = function (req, fn) {
// parse the "Proxy-Authorization" header
const auth = req.headers['proxy-authorization'];
if (!auth) {
// optimization: don't invoke the child process if no
// "Proxy-Authorization" header was given
// console.log('not Proxy-Authorization');
return fn(null, false);
}
const parsed = basicAuthParser(auth);
const isEqual = _.isEqual(parsed, proxyAuth);
// console.log('parsed "Proxy-Authorization": %j - %s', parsed, isEqual);
if (isEqual) wasProxyCalled = true;
fn(null, isEqual);
};