mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
Merge pull request #2318 from rwcarlsen/fix-closenotify-panic2
fix another panic where CloseNotify was called from wrong goroutine
This commit is contained in:
@ -114,9 +114,10 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
|
||||
defer cancel()
|
||||
|
||||
if cn, ok := w.(http.CloseNotifier); ok {
|
||||
clientGone := cn.CloseNotify()
|
||||
go func() {
|
||||
select {
|
||||
case <-cn.CloseNotify():
|
||||
case <-clientGone:
|
||||
case <-ctx.Done():
|
||||
}
|
||||
cancel()
|
||||
|
Reference in New Issue
Block a user