From 8d7c3f19ee93c4d41e5b4e5e0e94a58eebb31825 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 25 Oct 2022 12:02:15 +0200 Subject: [PATCH] live: explicitely reply with http 200 (#57428) (#57592) `pkg/web` triggers a panic when a http handler chain does not return any response to the client. This has been put in place, because it usually means a middleware along the way did not call the next one. In this specific case however, the handlers meant to return 200, but did not do so explicitely, instead relying on the default behavior of `net/http` (cherry picked from commit beaaabd770e540c463800e6d320884e3c6e00ae0) Co-authored-by: sh0rez --- pkg/services/live/pushhttp/push.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/live/pushhttp/push.go b/pkg/services/live/pushhttp/push.go index 3f70542db0f..61291cd7e4f 100644 --- a/pkg/services/live/pushhttp/push.go +++ b/pkg/services/live/pushhttp/push.go @@ -94,6 +94,8 @@ func (g *Gateway) Handle(ctx *models.ReqContext) { return } } + + ctx.Resp.WriteHeader(http.StatusOK) } func (g *Gateway) HandlePipelinePush(ctx *models.ReqContext) { @@ -126,4 +128,6 @@ func (g *Gateway) HandlePipelinePush(ctx *models.ReqContext) { ctx.Resp.WriteHeader(http.StatusNotFound) return } + + ctx.Resp.WriteHeader(http.StatusOK) }