Fix a nil dereference on non-custom 404 pages.

This commit is contained in:
Catherine
2025-10-27 16:14:35 +00:00
parent 91cafac86a
commit 2db3de01c7

View File

@@ -268,7 +268,7 @@ func getPage(w http.ResponseWriter, r *http.Request) error {
r.Header.Get("Accept-Encoding"))
}
if entry.ContentType != nil {
if entry != nil && entry.ContentType != nil {
w.Header().Set("X-Content-Type-Options", "nosniff")
w.Header().Set("Content-Type", *entry.ContentType)
mediaType := getMediaType(*entry.ContentType)