From 76697e26823855fba5d845bef84d6975a30801df Mon Sep 17 00:00:00 2001 From: Finn Date: Sun, 31 Mar 2024 23:20:10 -0700 Subject: [PATCH] Fix 404 handling --- serve.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serve.go b/serve.go index 7b2b57d..c1351eb 100644 --- a/serve.go +++ b/serve.go @@ -52,14 +52,14 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - slog.Info("GET", "domain", domain, "path", path) - stat, err := object.Stat() if err != nil { resp := minio.ToErrorResponse(err) if resp.StatusCode == http.StatusNotFound { // TODO: custom 404 page w.WriteHeader(http.StatusNotFound) + w.Write([]byte("404 not found")) + slog.Info("served 404", "domain", domain, "path", path) return }