diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-06 19:15:43 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-06 19:15:43 +0200 |
| commit | 412a77b7c1ba1819f4bf1c0697ddd19d7af21e19 (patch) | |
| tree | 911f3b54bc4bf05f7cfb819c31a08219e7b5ac59 /backend/data.go | |
| parent | 2aedff3d2bbdcad93d6ca0ec883c446c703cafaa (diff) | |
fix(frontend): malformed title and quote after hot update
Diffstat (limited to 'backend/data.go')
| -rw-r--r-- | backend/data.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/backend/data.go b/backend/data.go index bc3136c..2d9f97d 100644 --- a/backend/data.go +++ b/backend/data.go @@ -11,6 +11,7 @@ import ( "log/slog" "math/rand" "net/http" + "net/url" "regexp" "strings" ) @@ -93,8 +94,8 @@ func (d *data) handleGeneric(w http.ResponseWriter, r *http.Request, name string exec := "base.html" if r.Context().Value(isUpdateKey).(bool) { exec = "body" - w.Header().Set("Updated-Title", d.Title()) - w.Header().Set("Updated-Quote", d.Quote) + w.Header().Set("Updated-Title", url.QueryEscape(d.Title())) + w.Header().Set("Updated-Quote", url.QueryEscape(d.Quote)) } if custom == nil { err = t.ExecuteTemplate(w, exec, d) |
