From 8513def89942f55d55635401b0f6d04205d5dbb7 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 3 Jan 2019 15:43:44 -0500 Subject: [PATCH] Send correct status on 410/500 in handleHTTPError --- handle.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handle.go b/handle.go index 54947f7..706a2fa 100644 --- a/handle.go +++ b/handle.go @@ -525,6 +525,7 @@ func (h *Handler) handleHTTPError(w http.ResponseWriter, r *http.Request, err er sendRedirect(w, http.StatusFound, "/login?to="+r.URL.Path+q) return } else if err.Status == http.StatusGone { + w.WriteHeader(err.Status) p := &struct { page.StaticPage Content *template.HTML @@ -542,6 +543,7 @@ func (h *Handler) handleHTTPError(w http.ResponseWriter, r *http.Request, err er h.errors.NotFound.ExecuteTemplate(w, "base", pageForReq(h.app, r)) return } else if err.Status == http.StatusInternalServerError { + w.WriteHeader(err.Status) log.Info("handleHTTPErorr internal error render") h.errors.InternalServerError.ExecuteTemplate(w, "base", pageForReq(h.app, r)) return