License: MIT
diff --git a/svr.js b/svr.js
index 58caa71..5c95d6a 100644
--- a/svr.js
+++ b/svr.js
@@ -71,7 +71,7 @@ function deleteFolderRecursive(path) {
}
var os = require("os");
-var version = "3.4.29";
+var version = "3.4.30";
var singlethreaded = false;
if (process.versions) process.versions.svrjs = version; //Inject SVR.JS into process.versions
@@ -3863,6 +3863,7 @@ if (!cluster.isPrimary) {
//SANITIZE URL
var sanitizedHref = sanitizeURL(href);
+ var preparedReqUrl = uobject.pathname + (uobject.search ? uobject.search : "") + (uobject.hash ? uobject.hash : "");
if (href.toLowerCase() != sanitizedHref.toLowerCase() && !isProxy) {
var sanitizedURL = uobject;
@@ -3878,6 +3879,10 @@ if (!cluster.isPrimary) {
serverconsole.resmessage("URL sanitized: " + req.url + " => " + sanitizedURL);
redirect(sanitizedURL, false);
return;
+ } else if(req.url != preparedReqUrl && !isProxy) {
+ serverconsole.resmessage("URL sanitized: " + req.url + " => " + preparedReqUrl);
+ redirect(preparedReqUrl, false);
+ return;
}
//URL REWRITING
@@ -3916,7 +3921,9 @@ if (!cluster.isPrimary) {
}
var sHref = sanitizeURL(href);
- if (sHref != href.replace(/\/\.(?=\/|$)/g, "/").replace(/\/+/g, "/")) {
+ var preparedReqUrl2 = uobject.pathname + (uobject.search ? uobject.search : "") + (uobject.hash ? uobject.hash : "");
+
+ if (req.url != preparedReqUrl2 || sHref != href.replace(/\/\.(?=\/|$)/g, "/").replace(/\/+/g, "/")) {
callServerError(403);
serverconsole.errmessage("Content blocked.");
return;
diff --git a/tests.html b/tests.html
index fada1d9..bdc4afa 100644
--- a/tests.html
+++ b/tests.html
@@ -1,7 +1,7 @@
-
SVR.JS 3.4.29 Tests
+ SVR.JS 3.4.30 Tests
- SVR.JS 3.4.29 Tests
+ SVR.JS 3.4.30 Tests
Directory
Directory (with query)