mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 04:52:10 -07:00
revert changes from #723
This commit is contained in:
parent
c38de3a511
commit
821ce9aea2
1 changed files with 1 additions and 7 deletions
|
@ -116,13 +116,7 @@ func (p *HTTPProxy) onResponseFilter(res *http.Response, ctx *goproxy.ProxyCtx)
|
|||
if jsres != nil {
|
||||
// the response has been changed by the script
|
||||
p.logResponseAction(res.Request, jsres)
|
||||
raw, err := ioutil.ReadAll(jsres.ToResponse(res.Request).Body)
|
||||
if err == nil {
|
||||
html := string(raw)
|
||||
res.Header.Set("Content-Length", strconv.Itoa(len(html)))
|
||||
// reset the response body to the original unread state
|
||||
res.Body = ioutil.NopCloser(strings.NewReader(html))
|
||||
}
|
||||
return jsres.ToResponse(res.Request)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue