diff --git a/lib/requestHandler.js b/lib/requestHandler.js index 482d737..4940782 100644 --- a/lib/requestHandler.js +++ b/lib/requestHandler.js @@ -20,9 +20,10 @@ var defaultRule = require("./rule_default.js"), function userRequestHandler(req,userRes){ var host = req.headers.host, - urlPattern = url.parse(req.url), - path = urlPattern.path, protocol = (!!req.connection.encrypted && !/^http:/.test(req.url)) ? "https" : "http", + fullUrl = protocol + '://' + host + req.url, + urlPattern = url.parse(fullUrl), + path = urlPattern.path, resourceInfo, resourceInfoId = -1, reqData;