From de706f4a5176bff4dc308d440f05c3c138d1ace2 Mon Sep 17 00:00:00 2001 From: mu Date: Wed, 25 Oct 2023 17:49:21 +0800 Subject: [PATCH] Set json type when resp --- gobeansproxy/web.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gobeansproxy/web.go b/gobeansproxy/web.go index 2ff34cb..e1c6dbf 100644 --- a/gobeansproxy/web.go +++ b/gobeansproxy/web.go @@ -285,6 +285,7 @@ type ReloadableCfg struct { func handleCstarCfgReload(w http.ResponseWriter, r *http.Request) { defer handleWebPanic(w) + w.Header().Set("Content-Type", "application/json") resp := make(map[string]string) cfgName := r.URL.Query().Get("config") var dispatcher cassandra.PrefixDisPatcher @@ -412,6 +413,5 @@ func handleCstarCfgReload(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) resp["message"] = "success" } - w.Header().Set("Content-Type", "application/json") handleJson(w, resp) }