diff --git a/modules/http_proxy/http_proxy_base_sslstriper.go b/modules/http_proxy/http_proxy_base_sslstriper.go index 0c1d664b..1a4824f2 100644 --- a/modules/http_proxy/http_proxy_base_sslstriper.go +++ b/modules/http_proxy/http_proxy_base_sslstriper.go @@ -8,6 +8,7 @@ import ( "net/url" "regexp" "strings" + "strconv" "github.com/bettercap/bettercap/log" "github.com/bettercap/bettercap/packets" @@ -377,6 +378,8 @@ func (s *SSLStripper) Process(res *http.Response, ctx *goproxy.ProxyCtx) { s.hosts.Track(hostOriginal, hostStripped) } + res.Header.Set("Content-Length", strconv.Itoa(len(body))) + // reset the response body to the original unread state // but with just a string reader, this way further calls // to ioutil.ReadAll(res.Body) will just return the content