From 29656cdf255b1a5293985d8a1e591fc6e463dd35 Mon Sep 17 00:00:00 2001 From: mo Date: Thu, 13 Feb 2020 03:31:27 -0600 Subject: [PATCH] Remove Content-Length from response header If the pre-stripped response has a content-length header, the returned response will forward the original content-length and that will results in an incorrect response. --- modules/http_proxy/http_proxy_base_sslstriper.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/http_proxy/http_proxy_base_sslstriper.go b/modules/http_proxy/http_proxy_base_sslstriper.go index 0c1d664b..5cffcd6b 100644 --- a/modules/http_proxy/http_proxy_base_sslstriper.go +++ b/modules/http_proxy/http_proxy_base_sslstriper.go @@ -296,6 +296,7 @@ func (s *SSLStripper) fixResponseHeaders(res *http.Response) { res.Header.Del("X-Download-Options") res.Header.Del("X-Permitted-Cross-Domain-Policies") res.Header.Del("X-Xss-Protection") + res.Header.Del("Content-Length") res.Header.Set("Allow-Access-From-Same-Origin", "*") res.Header.Set("Access-Control-Allow-Origin", "*") res.Header.Set("Access-Control-Allow-Methods", "*")