Send correct status on 410/500 in handleHTTPError
This commit is contained in:
parent
19215b0355
commit
8513def899
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
sendRedirect(w, http.StatusFound, "/login?to="+r.URL.Path+q)
|
||||||
return
|
return
|
||||||
} else if err.Status == http.StatusGone {
|
} else if err.Status == http.StatusGone {
|
||||||
|
w.WriteHeader(err.Status)
|
||||||
p := &struct {
|
p := &struct {
|
||||||
page.StaticPage
|
page.StaticPage
|
||||||
Content *template.HTML
|
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))
|
h.errors.NotFound.ExecuteTemplate(w, "base", pageForReq(h.app, r))
|
||||||
return
|
return
|
||||||
} else if err.Status == http.StatusInternalServerError {
|
} else if err.Status == http.StatusInternalServerError {
|
||||||
|
w.WriteHeader(err.Status)
|
||||||
log.Info("handleHTTPErorr internal error render")
|
log.Info("handleHTTPErorr internal error render")
|
||||||
h.errors.InternalServerError.ExecuteTemplate(w, "base", pageForReq(h.app, r))
|
h.errors.InternalServerError.ExecuteTemplate(w, "base", pageForReq(h.app, r))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue