From 367b6481143ef604b3a812cdcecae966e4381434 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Mon, 10 Jun 2013 18:14:25 +0200 Subject: [PATCH] Avoid double ports in host header Previously, it was possible that the host header looks like domain.com:4444:4444 - obviously a bug. --- lib/cors-anywhere.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cors-anywhere.js b/lib/cors-anywhere.js index 2752231..17553ab 100644 --- a/lib/cors-anywhere.js +++ b/lib/cors-anywhere.js @@ -184,7 +184,7 @@ var getHandler = exports.getHandler = function(options) { }); // Only add port if it was explicitly set - req.headers.host = host + (match[4] ? ':' + port : ''); + req.headers.host = hostname + (match[4] ? ':' + port : ''); proxyRequest(req, res, proxy, full_url, { host: hostname,