Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

connect-modrewrite

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-modrewrite - npm Package Compare versions

Comparing version 0.7.11 to 0.7.12

4

index.js

@@ -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);
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc