about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-04-16 00:01:59 +0200
committerAlan Pearce2024-04-16 00:01:59 +0200
commit5fa3e47c00e5d584033c325f2ccdd3c917aa33a1 (patch)
tree2f296d19c9226db7aac7a568849dfc523c616404
parent8906942e9cb48906a67e4b17919accf51c18edc5 (diff)
downloadwebsite-5fa3e47c00e5d584033c325f2ccdd3c917aa33a1.tar.lz
website-5fa3e47c00e5d584033c325f2ccdd3c917aa33a1.tar.zst
website-5fa3e47c00e5d584033c325f2ccdd3c917aa33a1.zip
make GET 404.html return 404, not 200
-rw-r--r--src/app.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/app.ts b/src/app.ts
index da339c0..e6f82a3 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -163,7 +163,11 @@ export const server = {
       const file = files.get(pathname);
       let contentEncoding = "identity";
       let suffix = "";
-      if (file && (await file.handle.exists())) {
+      if (
+        !pathname.startsWith("/404.html") &&
+        file &&
+        (await file.handle.exists())
+      ) {
         let etagMatch = request.headers.get("if-none-match") === file.etag;
         let mtimeMatch =
           parseIfModifiedSinceHeader(