You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using the #727 example code to get NTLM working behind node-http-proxy, I saw an error on the second response from my node-sspi server.
In line 85 of http-outgoing.js an error was thrown that looked like this:
_http_outgoing.js:342
throw new Error('value required in setHeader("' + name + '", value).');
^
Error: value required in setHeader("www-authenticate", value).
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:342:11)
I created a net server that simply piped everything from the http-proxy to my app and another that piped everything from the browser to http-proxy and also outputted everything to stdout so I could compare what was going into and out of http-proxy. And when that error is thrown the header www-authenticate is not returned from node-sspi. It looks like it is somehow cached or held in a reused object inside of node-http-proxy.
My simple fix for now is to change line 85 of web-outgoing.js to: if(proxyRes.headers[key]){ res.setHeader(key, proxyRes.headers[key]);} but I'm not sure if that is the best solution since http-proxy is trying to set a header for which nothing was passed in.
The text was updated successfully, but these errors were encountered:
Looks like the pull request test in Travis CI timed out. Don't think the safety check I added should break anything. Could the test be restarted to see if it was just a network issue?
While using the #727 example code to get NTLM working behind node-http-proxy, I saw an error on the second response from my node-sspi server.
In line 85 of http-outgoing.js an error was thrown that looked like this:
I created a net server that simply piped everything from the http-proxy to my app and another that piped everything from the browser to http-proxy and also outputted everything to stdout so I could compare what was going into and out of http-proxy. And when that error is thrown the header www-authenticate is not returned from node-sspi. It looks like it is somehow cached or held in a reused object inside of node-http-proxy.
My simple fix for now is to change line 85 of web-outgoing.js to:
if(proxyRes.headers[key]){ res.setHeader(key, proxyRes.headers[key]);}
but I'm not sure if that is the best solution since http-proxy is trying to set a header for which nothing was passed in.The text was updated successfully, but these errors were encountered: