From 922cc6315ac340c300efb0e9aea5f7e045cb6099 Mon Sep 17 00:00:00 2001 From: Catherine Date: Tue, 23 Sep 2025 00:42:16 +0000 Subject: [PATCH] Use filename, not URL path, for MIME type sniffing. Otherwise, even though `/foo/index.html` and `/foo` are identical resources in every way, their MIME type could differ. --- src/pages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages.go b/src/pages.go index 0efdad0..0b464a7 100644 --- a/src/pages.go +++ b/src/pages.go @@ -202,7 +202,7 @@ func getPage(w http.ResponseWriter, r *http.Request) error { // see https://web.dev/articles/stale-while-revalidate for details // http.ServeContent handles content type and caching - http.ServeContent(w, r, sitePath, mtime, reader) + http.ServeContent(w, r, entryPath, mtime, reader) } return nil }