From dfe12ed5c22c6849fe198922c08b967251c9bdf3 Mon Sep 17 00:00:00 2001 From: Rob Day Date: Sun, 18 Feb 2018 18:27:05 +0000 Subject: [PATCH] httpproxy: cancel requests when client closes a connection --- proxy/httpproxy/reverse.go | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy/httpproxy/reverse.go b/proxy/httpproxy/reverse.go index fbde812c018..2ecff3aaea9 100644 --- a/proxy/httpproxy/reverse.go +++ b/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: } }()