diff --git a/context.go b/context.go index a2e28e5b..6f2c7c5e 100644 --- a/context.go +++ b/context.go @@ -1354,7 +1354,7 @@ func (c *Context) SSEvent(name string, message any) { // indicates "Is client disconnected in middle of stream" func (c *Context) Stream(step func(w io.Writer) bool) bool { w := c.Writer - clientGone := w.CloseNotify() + clientGone := c.Request.Context().Done() for { select { case <-clientGone: