connect-modrewrite
Advanced tools
Comparing version 0.8.3 to 0.8.5
14
index.js
@@ -38,3 +38,3 @@ | ||
return function(req, res, next) { | ||
var protocol = req.headers['x-forwarded-proto'] || req.connection.encrypted ? 'https' : 'http'; | ||
var protocol = req.connection.encrypted || req.headers['x-forwarded-proto'] === 'https' ? '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,4 +198,2 @@ callNext = false; | ||
var opts = _getRequestOpts(metas.req, rule); | ||
opts.protocol = metas.protocol + ':'; | ||
opts.slashes = true; | ||
var request = httpsSyntax.test(rule.replace) ? httpsReq : httpReq; | ||
@@ -234,3 +232,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 : ''; | ||
@@ -237,0 +235,0 @@ if(query) { |
{ | ||
"name": "connect-modrewrite", | ||
"main": "./index.js", | ||
"version": "0.8.3", | ||
"version": "0.8.5", | ||
"description": "connect-modrewrite adds modrewrite functionality to connect/express server", | ||
@@ -6,0 +6,0 @@ "author": { |
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
26156
696