about summary refs log tree commit diff stats
path: root/src/app.ts
diff options
context:
space:
mode:
authorAlan Pearce2024-04-16 00:33:13 +0200
committerAlan Pearce2024-04-16 00:33:13 +0200
commitf97814c2cdc8d34d5816afe7ed81c841ead84998 (patch)
treef61eccce87c6bbbcbae7e0298e0ec0d335d7668a /src/app.ts
parent5fa3e47c00e5d584033c325f2ccdd3c917aa33a1 (diff)
downloadwebsite-f97814c2cdc8d34d5816afe7ed81c841ead84998.tar.lz
website-f97814c2cdc8d34d5816afe7ed81c841ead84998.tar.zst
website-f97814c2cdc8d34d5816afe7ed81c841ead84998.zip
disallow fetching pre-compressed files directly
Diffstat (limited to 'src/app.ts')
-rw-r--r--src/app.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/app.ts b/src/app.ts
index e6f82a3..6e714f9 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -160,10 +160,12 @@ export const server = {
           },
         });
       }
+      const { base, ext } = path.parse(pathname);
       const file = files.get(pathname);
       let contentEncoding = "identity";
       let suffix = "";
       if (
+        ![".br", ".zst", ".gz"].includes(ext || base) &&
         !pathname.startsWith("/404.html") &&
         file &&
         (await file.handle.exists())