From c29f5a1b61765ed4164d56726b946cf1a7e56462 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 20 Jun 2018 12:18:35 +0100 Subject: [PATCH] Server command: map missing path to "/" Otherwise, the user gets a 404 if we use a path prefix and the user omits the trailing slash --- core/modules/commands/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/commands/server.js b/core/modules/commands/server.js index fcb097f1b..65790fc10 100644 --- a/core/modules/commands/server.js +++ b/core/modules/commands/server.js @@ -58,7 +58,7 @@ SimpleServer.prototype.findMatchingRoute = function(request,state) { match; if(pathprefix) { if(pathname.substr(0,pathprefix.length) === pathprefix) { - pathname = pathname.substr(pathprefix.length); + pathname = pathname.substr(pathprefix.length) || "/"; match = potentialRoute.path.exec(pathname); } else { match = false;