mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-24 10:01:04 +01:00
fix(modify-html): re-enable modifying HTML with chunked encoding
This commit is contained in:
@@ -47,9 +47,10 @@ func (m *modifyHTML) modifyResponse(resp *http.Response) error {
|
||||
|
||||
// Skip modification for streaming/chunked responses to avoid blocking reads
|
||||
// Unknown content length or any transfer encoding indicates streaming.
|
||||
if resp.ContentLength < 0 || len(resp.TransferEncoding) > 0 {
|
||||
return nil
|
||||
}
|
||||
// if resp.ContentLength < 0 || len(resp.TransferEncoding) > 0 {
|
||||
// log.Debug().Str("url", fullURL(resp.Request)).Strs("transfer-encoding", resp.TransferEncoding).Msg("skipping modification for streaming/chunked response")
|
||||
// return nil
|
||||
// }
|
||||
|
||||
// NOTE: do not put it in the defer, it will be used as resp.Body
|
||||
content, release, err := httputils.ReadAllBody(resp)
|
||||
|
||||
Reference in New Issue
Block a user