Skip to content

Commit

Permalink
chore: http.CloseNotify is deprecated, use context.Done instead
Browse files Browse the repository at this point in the history
Signed-off-by: 0xff-dev <stevenshuang521@gmail.com>
  • Loading branch information
0xff-dev committed Jun 13, 2024
1 parent 64ead9e commit f0905e5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -1137,10 +1137,9 @@ 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()
for {
select {
case <-clientGone:
case <-c.Request.Context().Done():
return true
default:
keepOpen := step(w)
Expand Down

0 comments on commit f0905e5

Please sign in to comment.