mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-24 22:33:16 +00:00
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
This commit is contained in:
parent
2a3f1b4403
commit
c29f5a1b61
|
@ -58,7 +58,7 @@ SimpleServer.prototype.findMatchingRoute = function(request,state) {
|
||||||
match;
|
match;
|
||||||
if(pathprefix) {
|
if(pathprefix) {
|
||||||
if(pathname.substr(0,pathprefix.length) === pathprefix) {
|
if(pathname.substr(0,pathprefix.length) === pathprefix) {
|
||||||
pathname = pathname.substr(pathprefix.length);
|
pathname = pathname.substr(pathprefix.length) || "/";
|
||||||
match = potentialRoute.path.exec(pathname);
|
match = potentialRoute.path.exec(pathname);
|
||||||
} else {
|
} else {
|
||||||
match = false;
|
match = false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user