From 412a77b7c1ba1819f4bf1c0697ddd19d7af21e19 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 6 Oct 2025 19:15:43 +0200 Subject: fix(frontend): malformed title and quote after hot update --- backend/data.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'backend/data.go') 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) -- cgit v1.2.3