Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Copy response headers case-insensitively

  • Loading branch information...
commit 35c882d5bbf7e3c307f9dd10beac8edcf7d872e4 1 parent 2499b20
@gilad61 authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/node-http-proxy/http-proxy.js
View
5 lib/node-http-proxy/http-proxy.js
@@ -244,7 +244,10 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
}
// Set the headers of the client response
- res.writeHead(response.statusCode, response.headers);
+ Object.keys(response.headers).forEach(function(key){
+ res.setHeader(key, response.headers[key]);
+ });
+ res.writeHead(response.statusCode);
// If `response.statusCode === 304`: No 'data' event and no 'end'
if (response.statusCode === 304) {
Please sign in to comment.
Something went wrong with that request. Please try again.