From 0cdb10448ab010811625856da765ae8355038cab Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Fri, 9 Oct 2020 15:39:29 -0700 Subject: 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(-) (limited to 'pkg/api/handlers') diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index 9efdd1261..a729b84d4 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 } - } } -- cgit v1.2.3-54-g00ecf