From c63e8a7e91a5d3ac99b9513dea9aae66a0a8f379 Mon Sep 17 00:00:00 2001 From: Christian Simon Date: Tue, 22 Feb 2022 13:51:57 +0000 Subject: [PATCH 1/3] Ensure the services status page renders as HTML --- pkg/mimir/status.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/mimir/status.go b/pkg/mimir/status.go index 5acb1ed0690..e5207a0f07c 100644 --- a/pkg/mimir/status.go +++ b/pkg/mimir/status.go @@ -56,7 +56,6 @@ func init() { func (t *Mimir) servicesHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) - w.Header().Set("Content-Type", "text/plain") svcs := make([]renderService, 0) for mod, s := range t.ServiceMap { From 0f6dfd60be9b717cdf59e915f18999617c78266a Mon Sep 17 00:00:00 2001 From: Christian Simon Date: Wed, 23 Feb 2022 10:17:47 +0000 Subject: [PATCH 2/3] Fix spelling of services' status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > Services’ status [seeing status information about more than one service] --- pkg/api/api.go | 2 +- pkg/mimir/status.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/api/api.go b/pkg/api/api.go index 44125619700..74b03b765f2 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -396,7 +396,7 @@ func (a *API) RegisterQueryScheduler(f *scheduler.Scheduler) { // TODO: Refactor this code to be accomplished using the services.ServiceManager // or a future module manager #2291 func (a *API) RegisterServiceMapHandler(handler http.Handler) { - a.indexPage.AddLink(SectionAdminEndpoints, "/services", "Service Status") + a.indexPage.AddLink(SectionAdminEndpoints, "/services", "Service's status") a.RegisterRoute("/services", handler, false, true, "GET") } diff --git a/pkg/mimir/status.go b/pkg/mimir/status.go index e5207a0f07c..32370897d18 100644 --- a/pkg/mimir/status.go +++ b/pkg/mimir/status.go @@ -19,10 +19,10 @@ const tpl = ` - Services Status + Services' status -

Services Status

+

Services' status

Current time: {{ .Now }}

From f8588ac5946ce879fdde7dbd60cdd1bed67693f8 Mon Sep 17 00:00:00 2001 From: Christian Simon Date: Mon, 7 Mar 2022 18:32:13 +0000 Subject: [PATCH 3/3] Set text/html type explicitly and do not call WriteHeader --- pkg/mimir/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mimir/status.go b/pkg/mimir/status.go index 32370897d18..4057817d591 100644 --- a/pkg/mimir/status.go +++ b/pkg/mimir/status.go @@ -55,7 +55,7 @@ func init() { } func (t *Mimir) servicesHandler(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) + w.Header().Set("Content-Type", "text/html; utf=8") svcs := make([]renderService, 0) for mod, s := range t.ServiceMap {