mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-11 21:33:13 +00:00
#8759 fix issue with path-prefix
This commit is contained in:
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user