fix: prevent folks messing with the fresh manifest (#435)
I am looking at you James.
This commit is contained in:
@@ -105,7 +105,7 @@ export class ServerContext {
|
||||
let error: ErrorPage = DEFAULT_ERROR;
|
||||
for (const [self, module] of Object.entries(manifest.routes)) {
|
||||
const url = new URL(self, baseUrl).href;
|
||||
if (!url.startsWith(baseUrl)) {
|
||||
if (!url.startsWith(baseUrl + "routes")) {
|
||||
throw new TypeError("Page is not a child of the basepath.");
|
||||
}
|
||||
const path = url.substring(baseUrl.length).substring("routes".length);
|
||||
|
||||
Reference in New Issue
Block a user