From 2db3de01c718076bf0bc04e3a823e847346afecc Mon Sep 17 00:00:00 2001 From: Catherine Date: Mon, 27 Oct 2025 16:14:35 +0000 Subject: [PATCH] Fix a nil dereference on non-custom 404 pages. --- src/pages.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages.go b/src/pages.go index 78bb1a6..6f98f97 100644 --- a/src/pages.go +++ b/src/pages.go @@ -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)