From f650726feca28684b75646a1e8641751d5825c52 Mon Sep 17 00:00:00 2001 From: Rob Day Date: Sun, 18 Feb 2018 18:27:05 +0000 Subject: [PATCH] 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 fbde812c0188..2ecff3aaea94 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: } }()