From 96e73576afcd00cd4c9923b9ba9eba62166a7dd8 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 5 Mar 2024 06:40:57 +0100 Subject: [PATCH] set content-type for customjavascript (#3612) * set content-type for customjavascript * change content-type in order to comply with RFC 9239 --- controllers/customJavascript.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/customJavascript.go b/controllers/customJavascript.go index f20dfdf25..dc6cf17a9 100644 --- a/controllers/customJavascript.go +++ b/controllers/customJavascript.go @@ -8,6 +8,8 @@ import ( // ServeCustomJavascript will serve optional custom Javascript. func ServeCustomJavascript(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/javascript; charset=utf-8") + js := data.GetCustomJavascript() _, _ = w.Write([]byte(js)) }