From beaaabd770e540c463800e6d320884e3c6e00ae0 Mon Sep 17 00:00:00 2001 From: sh0rez Date: Tue, 25 Oct 2022 11:45:54 +0200 Subject: [PATCH] live: explicitely reply with http 200 (#57428) `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` --- 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) }