HTTP handler removing any query string before comparisons
authorDarren <darren@darrenwhitlen.com>
Thu, 11 Sep 2014 20:06:25 +0000 (21:06 +0100)
committerDarren <darren@darrenwhitlen.com>
Thu, 11 Sep 2014 20:06:25 +0000 (21:06 +0100)
server/httphandler.js

index c55dc570e8ff7403935cd28d0b8b92e862cda18a..bb56b900d1f3163654706ebd07472a7fdc0cbed8 100644 (file)
@@ -32,8 +32,8 @@ HttpHandler.prototype.serve = function (request, response) {
         base_path = base_path.substr(0, base_path.length - 1);
     }
 
-    // Normalise the URL to compare against the base_path
-    base_check = request.url;
+    // Normalise the URL + remove query strings to compare against the base_path
+    base_check = request.url.split('?')[0];
     if (base_check.substr(base_check.length - 1) !== '/') {
         base_check += '/';
     }