From c4d185dca9696c77d5c38d24d897c2679f6762a0 Mon Sep 17 00:00:00 2001 From: Romain Date: Tue, 24 Apr 2012 10:22:56 +0300 Subject: [PATCH] prefer `target.hostname` over `target.host` --- lib/node-http-proxy/http-proxy.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index bd8434a65..7f2575103 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -209,12 +209,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { // // Setup outgoing proxy with relevant properties. // - outgoing.host = this.target.host; - outgoing.port = this.target.port; - outgoing.agent = this.target.agent; - outgoing.method = req.method; - outgoing.path = req.url; - outgoing.headers = req.headers; + outgoing.host = this.target.host; + outgoing.hostname = this.target.hostname; + outgoing.port = this.target.port; + outgoing.agent = this.target.agent; + outgoing.method = req.method; + outgoing.path = req.url; + outgoing.headers = req.headers; // // Open new HTTP request to internal resource with will act