all repos — homestead @ 97b600d40737f80f76c103dfbe083fbfe299b5d7

Code for my website

disallow fetching pre-compressed files directly

Alan Pearce
commit

97b600d40737f80f76c103dfbe083fbfe299b5d7

parent

f112bd0d351176730934aca23fdcc925805c6ce3

1 file changed, 2 insertions(+), 0 deletions(-)

jump to
M src/app.tssrc/app.ts
@@ -160,10 +160,12 @@ location: new URL(pathname, expectedHostURL).toString(),
}, }); } + 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())