connect-modrewrite
Advanced tools
Comparing version 0.8.2 to 0.8.3
14
index.js
@@ -38,3 +38,3 @@ | ||
return function(req, res, next) { | ||
var protocol = req.connection.encrypted || req.headers['x-forwarded-proto'] === 'https' ? 'https' : 'http'; | ||
var protocol = req.headers['x-forwarded-proto'] || req.connection.encrypted ? 'https' : 'http'; | ||
var callNext = true; | ||
@@ -95,6 +95,6 @@ | ||
_proxy(rule, { | ||
protocol : protocol, | ||
req : req, | ||
res : res, | ||
next : next | ||
protocol: protocol, | ||
req: req, | ||
res: res, | ||
next: next | ||
}); | ||
@@ -198,2 +198,4 @@ callNext = false; | ||
var opts = _getRequestOpts(metas.req, rule); | ||
opts.protocol = metas.protocol + ':'; | ||
opts.slashes = true; | ||
var request = httpsSyntax.test(rule.replace) ? httpsReq : httpReq; | ||
@@ -232,3 +234,3 @@ | ||
var opts = url.parse(req.url.replace(rule.regexp, rule.replace), true); | ||
var query = (opts.search != null) ? opts.search : ''; | ||
var query = (opts.search !== null) ? opts.search : ''; | ||
@@ -235,0 +237,0 @@ if(query) { |
{ | ||
"name": "connect-modrewrite", | ||
"main": "./index.js", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"description": "connect-modrewrite adds modrewrite functionality to connect/express server", | ||
@@ -18,3 +18,3 @@ "author": { | ||
"type": "git", | ||
"url": "git://github.com:tinganho/connect-modrewrite.git" | ||
"url": "https://github.com/tinganho/connect-modrewrite.git" | ||
}, | ||
@@ -21,0 +21,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26204
698