Browse Source

Merge pull request #9336 from rkd-msw/iss_9335_fix

httpproxy: cancel requests when client closes a connection
Xiang Li 7 years ago
parent
commit
0b5c660c1d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      proxy/httpproxy/reverse.go

+ 1 - 0
proxy/httpproxy/reverse.go

@@ -119,6 +119,7 @@ func (p *reverseProxy) ServeHTTP(rw http.ResponseWriter, clientreq *http.Request
 			case <-closeCh:
 				atomic.StoreInt32(&requestClosed, 1)
 				plog.Printf("client %v closed request prematurely", clientreq.RemoteAddr)
+				cancel()
 			case <-completeCh:
 			}
 		}()