connect-modrewrite
Advanced tools
Comparing version 0.7.2 to 0.7.3
16
index.js
@@ -23,3 +23,3 @@ | ||
, typeSyntax = /T=([\w|\/]+,?)/ | ||
, hostSyntax = /H=(.+),?/ | ||
, hostSyntax = /H=([\w|\d|\:|\.]),?/ | ||
, flagSyntax = /\[(.*)\]$/ | ||
@@ -43,4 +43,2 @@ , partsSyntax = /\s+|\t+/g | ||
rules.some(function(rule) { | ||
var location = protocol + '://' + req.headers.host + req.url.replace(rule.regexp, rule.replace) | ||
, match = rule.regexp.test(req.url); | ||
@@ -53,2 +51,5 @@ if(rule.host) { | ||
var location = protocol + '://' + req.headers.host + req.url.replace(rule.regexp, rule.replace) | ||
, match = rule.regexp.test(req.url); | ||
// If not match | ||
@@ -138,2 +139,11 @@ if(!match) { | ||
return (rules || []).map(function(rule) { | ||
// Reset all regular expression indexes | ||
lastSyntax.lastIndex = 0; | ||
proxySyntax.lastIndex = 0; | ||
redirectSyntax.lastIndex = 0; | ||
forbiddenSyntax.lastIndex = 0; | ||
goneSyntax.lastIndex = 0; | ||
typeSyntax.lastIndex = 0; | ||
hostSyntax.lastIndex = 0; | ||
var parts = rule.replace(partsSyntax, ' ').split(' '), flags = ''; | ||
@@ -140,0 +150,0 @@ |
{ | ||
"name": "connect-modrewrite", | ||
"main": "./index.js", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "connect-modrewrite adds modrewrite functionality to connect/express server", | ||
@@ -6,0 +6,0 @@ "author": { |
22145
578