forked from svrjs/svrjs
Fix URL rewriting on URLs with double slashes
This commit is contained in:
parent
28d633884e
commit
2f232614a2
1 changed files with 4 additions and 1 deletions
5
svr.js
5
svr.js
|
@ -4315,7 +4315,10 @@ if (!cluster.isPrimary) {
|
||||||
doCallback = false;
|
doCallback = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!mapEntry.allowDoubleSlashes) address = address.replace(/\/+/g,"/");
|
if (!mapEntry.allowDoubleSlashes) {
|
||||||
|
address = address.replace(/\/+/g,"/");
|
||||||
|
rewrittenURL = address;
|
||||||
|
}
|
||||||
if (matchHostname(mapEntry.host) && ipMatch(mapEntry.ip, req.socket ? req.socket.localAddress : undefined) && address.match(createRegex(mapEntry.definingRegex)) && !(mapEntry.isNotDirectory && _fileState == 2) && !(mapEntry.isNotFile && _fileState == 1)) {
|
if (matchHostname(mapEntry.host) && ipMatch(mapEntry.ip, req.socket ? req.socket.localAddress : undefined) && address.match(createRegex(mapEntry.definingRegex)) && !(mapEntry.isNotDirectory && _fileState == 2) && !(mapEntry.isNotFile && _fileState == 1)) {
|
||||||
try {
|
try {
|
||||||
mapEntry.replacements.forEach(function (replacement) {
|
mapEntry.replacements.forEach(function (replacement) {
|
||||||
|
|
Reference in a new issue