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.
This commit is contained in:
Catherine
2025-09-23 00:42:19 +00:00
parent 38269c66ae
commit 922cc6315a
+1 -1
View File
@@ -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
}