From 750be7f07e6528e9fd10c4d672111d407a7c8898 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Fri, 11 Mar 2022 15:56:54 -0500 Subject: [PATCH] Fix content type for config.js --- server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server.go b/server/server.go index ddbdb9c5..e1ed94b8 100644 --- a/server/server.go +++ b/server/server.go @@ -340,9 +340,9 @@ func (s *Server) handleWebConfig(w http.ResponseWriter, r *http.Request) error { appRoot = "/app" } disallowedTopicsStr := `"` + strings.Join(disallowedTopics, `", "`) + `"` - w.Header().Set("Content-Type", "application/json") + w.Header().Set("Content-Type", "text/javascript") _, err := io.WriteString(w, fmt.Sprintf(`// Generated server configuration -var config = { +var config = { appRoot: "%s", disallowedTopics: [%s] };`, appRoot, disallowedTopicsStr))