From 9c1f3c395d36fdca04a37406bff1cdae028dbef1 Mon Sep 17 00:00:00 2001 From: Adit Sachde <23707194+aditsachde@users.noreply.github.com> Date: Thu, 12 Sep 2024 16:48:25 -0400 Subject: [PATCH] Specify content encoding on text/plain responses --- cmd/internal/http/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/internal/http/server.go b/cmd/internal/http/server.go index 355ed70..ac252ef 100644 --- a/cmd/internal/http/server.go +++ b/cmd/internal/http/server.go @@ -93,7 +93,7 @@ func (s *Server) getCheckpointN(w http.ResponseWriter, r *http.Request) { http.Error(w, "failed to get checkpoint", httpForCode(status.Code(err))) return } - w.Header().Set("Content-Type", "text/plain") + w.Header().Set("Content-Type", "text/plain; charset=utf-8") if _, err := w.Write(chkpt); err != nil { glog.Errorf("w.Write(): %v", err) } @@ -112,7 +112,7 @@ func (s *Server) getCheckpointWitness(w http.ResponseWriter, r *http.Request) { http.Error(w, "failed to get checkpoint", httpForCode(status.Code(err))) return } - w.Header().Set("Content-Type", "text/plain") + w.Header().Set("Content-Type", "text/plain; charset=utf-8") if _, err := w.Write(chkpt); err != nil { glog.Errorf("w.Write(): %v", err) }