mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 17:28:31 +02: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
|
// Skip modification for streaming/chunked responses to avoid blocking reads
|
||||||
// Unknown content length or any transfer encoding indicates streaming.
|
// Unknown content length or any transfer encoding indicates streaming.
|
||||||
if resp.ContentLength < 0 || len(resp.TransferEncoding) > 0 {
|
// if resp.ContentLength < 0 || len(resp.TransferEncoding) > 0 {
|
||||||
return nil
|
// 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
|
// NOTE: do not put it in the defer, it will be used as resp.Body
|
||||||
content, release, err := httputils.ReadAllBody(resp)
|
content, release, err := httputils.ReadAllBody(resp)
|
||||||
|
|||||||
Reference in New Issue
Block a user