core/ui: fix page title (#4957)

* core/ui: fix page title

* cache template
This commit is contained in:
Caleb Doxsey 2024-02-12 14:05:18 -07:00 committed by GitHub
parent 76862c2fe8
commit c6d1f17100
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 56 additions and 31 deletions

View file

@ -2,6 +2,7 @@ package httputil
import (
"context"
"fmt"
"net/http"
"net/url"
@ -101,7 +102,7 @@ func (e *HTTPError) ErrorResponse(ctx context.Context, w http.ResponseWriter, r
w.Header().Set("Content-Type", "text/html; charset=UTF-8")
w.WriteHeader(response.Status)
if err := ui.ServePage(w, r, "Error", m); err != nil {
if err := ui.ServePage(w, r, "Error", fmt.Sprintf("%d %s", response.Status, response.StatusText), m); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}