Commit eaa4ff0c authored by Jeromy Johnson's avatar Jeromy Johnson

Merge pull request #2318 from rwcarlsen/fix-closenotify-panic2

fix another panic where CloseNotify was called from wrong goroutine
parents 37258a26 5367ee76
...@@ -114,9 +114,10 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request ...@@ -114,9 +114,10 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
defer cancel() defer cancel()
if cn, ok := w.(http.CloseNotifier); ok { if cn, ok := w.(http.CloseNotifier); ok {
clientGone := cn.CloseNotify()
go func() { go func() {
select { select {
case <-cn.CloseNotify(): case <-clientGone:
case <-ctx.Done(): case <-ctx.Done():
} }
cancel() cancel()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment