Set Proxy-Authorization when needed (#1146)

fixes #1145
This commit is contained in:
timolehto 2017-06-29 17:55:12 +03:00 committed by Nick O'Leary
parent adca1d7855
commit 4c9f1369c8
1 changed files with 3 additions and 0 deletions

View File

@ -188,6 +188,9 @@ module.exports = function(RED) {
opts.headers = heads;
opts.method = method;
urltotest = match[0];
if (opts.auth) {
opts.headers['Proxy-Authorization'] = "Basic "+new Buffer(opts.auth).toString('Base64')
}
}
else { node.warn("Bad proxy url: "+process.env.http_proxy); }
}