connect-modrewrite
Advanced tools
Comparing version 0.7.11 to 0.7.12
@@ -115,3 +115,5 @@ | ||
if(!rule.inverted) { | ||
req.url = req.url.replace(rule.regexp, rule.replace); | ||
if (rule.replace !== '-') { | ||
req.url = req.url.replace(rule.regexp, rule.replace); | ||
} | ||
return rule.last; | ||
@@ -118,0 +120,0 @@ } |
{ | ||
"name": "connect-modrewrite", | ||
"main": "./index.js", | ||
"version": "0.7.11", | ||
"version": "0.7.12", | ||
"description": "connect-modrewrite adds modrewrite functionality to connect/express server", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -437,2 +437,22 @@ | ||
}); | ||
describe('leave untouched', function() { | ||
it('should use the current rule if the host match', function() { | ||
var middleware = modRewrite(['^/a - [L]']); | ||
var url = '/a/foo/bar/woot'; | ||
var req = { | ||
connection : { encrypted : false }, | ||
header : function() {}, | ||
headers : { host : 'test.com' }, | ||
url : url | ||
}; | ||
var res = { | ||
writeHead : function() {}, | ||
end : function() {} | ||
}; | ||
var next = function() {}; | ||
middleware(req, res, next); | ||
expect(req.url).to.equal(url); | ||
}); | ||
}); | ||
}); |
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
25399
675