1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-11 21:33:13 +00:00

fix issue with path-prefix

This commit is contained in:
webplusai 2024-11-22 08:47:45 +00:00
parent 0cd2190ddf
commit a4ee6bc2df

@ -466,6 +466,20 @@ Server.prototype.requestHandler = function(request,response,options) {
return;
}
if (state.pathPrefix && !request.url.startsWith(state.pathPrefix)) {
// Prepend pathPrefix to request url
request.url = state.pathPrefix + request.url;
state.urlInfo = url.parse(request.url);
state.queryParameters = querystring.parse(state.urlInfo.query);
if(request.method === "GET") {
response.writeHead(301, {
'Location': request.url
});
response.end();
return;
}
}
// Find the route that matches this path
var route = self.findMatchingRoute(request,state);