From cec79dd706a1ab640116a13c184230719d3a7e91 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 fbde812c0..2ecff3aae 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: } }()