core/ui: fix page title

This commit is contained in:
Caleb Doxsey 2024-02-08 09:41:12 -07:00
parent f9808a73ba
commit e7ea364ecb
9 changed files with 39 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)
}
}