From 3b39d2c3dcb1785cc06043fcb226c652f554941e Mon Sep 17 00:00:00 2001 From: merpnderp Date: Fri, 22 Jan 2016 09:17:14 -0600 Subject: [PATCH] Added check to passes/web-outgoing.js to make sure the header being set is not undefined, which should be the only falsey value that could accidently show up and break that call. This fixes windows NTLM auth issues behind http-proxy. --- lib/http-proxy/passes/web-outgoing.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/http-proxy/passes/web-outgoing.js b/lib/http-proxy/passes/web-outgoing.js index 977f1f747..ad8b8d0c8 100644 --- a/lib/http-proxy/passes/web-outgoing.js +++ b/lib/http-proxy/passes/web-outgoing.js @@ -82,7 +82,9 @@ var redirectRegex = /^30(1|2|7|8)$/; */ function writeHeaders(req, res, proxyRes) { Object.keys(proxyRes.headers).forEach(function(key) { - res.setHeader(key, proxyRes.headers[key]); + if(proxyRes.headers[key] != undefined){ + res.setHeader(key, proxyRes.headers[key]); + } }); },