1
0
Fork 0
forked from svrjs/svrjs

Fixed bug with non-standard code regex replacements

This commit is contained in:
Dorian Niemiec 2023-09-17 23:32:42 +02:00
parent a2ecbe4c5a
commit fccc0ef7ca

2
svr.js
View file

@ -4231,7 +4231,7 @@ if (!cluster.isPrimary) {
// Regex match // Regex match
var createdRegex = createRegex(nonStandardCodes[i].regex, true); var createdRegex = createRegex(nonStandardCodes[i].regex, true);
isMatch = req.url.match(createdRegex) || href.match(createdRegex); isMatch = req.url.match(createdRegex) || href.match(createdRegex);
regexI.push(createdRegex); regexI[i] = createdRegex;
} else { } else {
// Non-regex match // Non-regex match
isMatch = nonStandardCodes[i].url == href || (os.platform() == "win32" && nonStandardCodes[i].url.toLowerCase() == href.toLowerCase()); isMatch = nonStandardCodes[i].url == href || (os.platform() == "win32" && nonStandardCodes[i].url.toLowerCase() == href.toLowerCase());