all repos — website @ 5fa3e47c00e5d584033c325f2ccdd3c917aa33a1

My website

make GET 404.html return 404, not 200

Alan Pearce
commit

5fa3e47c00e5d584033c325f2ccdd3c917aa33a1

parent

8906942e9cb48906a67e4b17919accf51c18edc5

1 file changed, 5 insertions(+), 1 deletion(-)

changed files
M src/app.tssrc/app.ts
@@ -163,7 +163,11 @@ }
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(