fix http req over https

This commit is contained in:
加里
2014-08-11 17:48:32 +08:00
parent 022902943f
commit df1bc9911a
5 changed files with 7 additions and 3 deletions

View File

@@ -2,8 +2,9 @@ var http = require("http"),
https = require("https");
function handler(req,userRes){
console.log(req);
var ifHttps = !!req.connection.encrypted;
var ifHttps = !!req.connection.encrypted && !/http:/.test(req.url);
var options = {
hostname : req.headers.host,