all repos — homestead @ f112bd0d351176730934aca23fdcc925805c6ce3

Code for my website

make GET 404.html return 404, not 200

Alan Pearce
commit

f112bd0d351176730934aca23fdcc925805c6ce3

parent

4e71dbf346c4a9476df948daf9d3a308a263125c

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

jump to
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(