diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index e4a0c86..494b8a9 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -239,7 +239,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { if (this.changeOrigin) { outgoing.headers.host = this.target.host; // Only add port information to the header if not default port - // for this protocol. + // for this protocol. // See https://github.com/nodejitsu/node-http-proxy/issues/458 if (this.target.port !== 443 && this.target.https || this.target.port !== 80 && !this.target.https) { @@ -334,10 +334,10 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { // Set the headers of the client response if (res.sentHeaders !== true) { - Object.keys(response.headers).forEach(function (key) { - res.setHeader(key, response.headers[key]); - }); - res.writeHead(response.statusCode); + Object.keys(response.headers).forEach(function (key) { + res.setHeader(key, response.headers[key]); + }); + res.writeHead(response.statusCode); } function ondata(chunk) {