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
@@ -19,6 +19,10 @@ export default async function ({ req }: Params): Promise<Response> {
url.pathname.replace(/^\/public/, ""),
);
if (!file_path.startsWith(PUBLIC_DIR + path.sep)) {
return new Response("Forbidden", { status: 403 });
}
if (!existsSync(file_path)) {
return new Response(`Public File Doesn't Exist`, {
status: 404,