all repos — website @ f97814c2cdc8d34d5816afe7ed81c841ead84998

My website

disallow fetching pre-compressed files directly

Alan Pearce
commit

f97814c2cdc8d34d5816afe7ed81c841ead84998

parent

5fa3e47c00e5d584033c325f2ccdd3c917aa33a1

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

changed files
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())