diff --git a/lib/server.js b/lib/server.js index e20aee30..bf93daaa 100644 --- a/lib/server.js +++ b/lib/server.js @@ -101,8 +101,12 @@ Util.log('* Redirection http -> https is setted up'); lServerLog(lHTTP, lPort); var lRedirectServer = http.createServer( function(pReq, pRes) { - var lHost = pReq.headers.host, - lURL = lHTTPS + lHost + pReq.url + ':' + lSSLPort; + var lURL, + lHost = pReq.headers.host, + lParsed = URL.parse(lHost), + lHostName = lParsed.protocol; + + lURL = lHTTPS + lHostName + lSSLPort + pReq.url; main.redirect({ response: pRes,