Skip to content

Commit

Permalink
revert changes from #723
Browse files Browse the repository at this point in the history
  • Loading branch information
buffermet committed May 1, 2021
1 parent c38de3a commit 821ce9a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions modules/http_proxy/http_proxy_base_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 821ce9a

Please sign in to comment.