From 64b215e6c883246e3f4057b236eaaa355c9e9e2b Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 9 Oct 2020 15:39:29 -0700 Subject: [PATCH] Monitor for client closing stream Fixes #7946 Signed-off-by: Jhon Honce --- pkg/api/handlers/compat/events.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index 9efdd12613..a729b84d4d 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -139,7 +139,8 @@ func GetEvents(w http.ResponseWriter, r *http.Request) { if flusher, ok := w.(http.Flusher); ok { flusher.Flush() } + case <-r.Context().Done(): + return } - } }