From 077f8cbe1c7a2e5afe2aa981e320e2d014d65e37 Mon Sep 17 00:00:00 2001 From: faceair Date: Fri, 13 Nov 2020 02:17:37 -0600 Subject: [PATCH] add charset on targets response (#897) --- app/vmagent/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/vmagent/main.go b/app/vmagent/main.go index 4d2b7acb5..1f2e28249 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -208,13 +208,13 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { return true case "/targets": promscrapeTargetsRequests.Inc() - w.Header().Set("Content-Type", "text/plain") + w.Header().Set("Content-Type", "text/plain; charset=utf-8") showOriginalLabels, _ := strconv.ParseBool(r.FormValue("show_original_labels")) promscrape.WriteHumanReadableTargetsStatus(w, showOriginalLabels) return true case "/api/v1/targets": promscrapeAPIV1TargetsRequests.Inc() - w.Header().Set("Content-Type", "application/json") + w.Header().Set("Content-Type", "application/json; charset=utf-8") state := r.FormValue("state") promscrape.WriteAPIV1Targets(w, state) return true