From 6b89a0b9d7acf4ab27faa1efda251ce1d01145c8 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 1 Sep 2015 11:08:41 +0800 Subject: [PATCH] Get full url for https and http separately. --- lib/requestHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/requestHandler.js b/lib/requestHandler.js index 4940782..be501a7 100644 --- a/lib/requestHandler.js +++ b/lib/requestHandler.js @@ -21,7 +21,7 @@ function userRequestHandler(req,userRes){ var host = req.headers.host, protocol = (!!req.connection.encrypted && !/^http:/.test(req.url)) ? "https" : "http", - fullUrl = protocol + '://' + host + req.url, + fullUrl = protocol === "http" ? req.url : (protocol + '://' + host + req.url), urlPattern = url.parse(fullUrl), path = urlPattern.path, resourceInfo,