Skip to content

Commit 8d0a58a

Browse files
geofffranksebroberson
authored andcommitted
Update deprecated CloseNotify() call with the req.Context().Done() channel instead
1 parent 816d1f5 commit 8d0a58a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

handlers/event_stream_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ func (h *EventStreamHandler) handleEventStream(log lager.Logger, filterKey strin
6666
return
6767
}
6868
flusher := w.(http.Flusher)
69-
closeNotifier := w.(http.CloseNotifier).CloseNotify()
70-
69+
reqCtx := req.Context()
70+
closeNotifier := reqCtx.Done()
7171
resultChan, errChan, cancelFunc := h.db.WatchChanges(filterKey)
7272

7373
w.Header().Add("Content-Type", "text/event-stream; charset=utf-8")

0 commit comments

Comments
 (0)