Fix errors, bugs and known vulerabilities

This commit is contained in:
2026-03-23 06:58:41 +01:00
parent 0308ea32ec
commit 567fb4f746
15 changed files with 84 additions and 52 deletions
+4
View File
@@ -15,6 +15,10 @@ export default async function ({ req }: Params): Promise<Response> {
const url = new URL(req.url);
const file_path = path.join(PUBLIC_DIR, url.pathname);
if (!file_path.startsWith(PUBLIC_DIR + path.sep)) {
return new Response("Forbidden", { status: 403 });
}
if (!existsSync(file_path)) {
return new Response(`File Doesn't Exist`, {
status: 404,