HTTP Content-Type für HTML-Seiten explizit setzen

This commit is contained in:
Kai
2026-02-16 15:11:33 +01:00
parent 67bd87e12a
commit 53d4052446

View File

@@ -11,6 +11,7 @@ func (a *App) renderTemplate(w http.ResponseWriter, path string, data any) {
http.Error(w, "template parse failed", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
if err := tmpl.Execute(w, data); err != nil {
http.Error(w, "template render failed", http.StatusInternalServerError)
}