fix: prevent folks messing with the fresh manifest (#435)

I am looking at you James.
This commit is contained in:
Luca Casonato
2022-07-05 19:35:03 +00:00
committed by GitHub
parent 86daf73d47
commit 03aa58df87
+1 -1
View File
@@ -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);