Revert "HTTP: don't drain GET request bodies" (#28086)

This commit is contained in:
andig 2026-03-10 12:01:22 +01:00 • committed by GitHub
parent 5d528fa738
commit e5240a138c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,7 +108,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
bld.WriteString("\n")
bld.Write(bytes.TrimSpace(body[:min(LogMaxLen, len(body))]))
}
} else if req.Method != http.MethodGet {
} else {
if save, req.Body, err = drainBody(req.Body); err == nil {
err = dump(save, bld)
}
@ -130,7 +130,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
bld.WriteString("\n\n")
bld.Write(bytes.TrimSpace(body[:min(LogMaxLen, len(body))]))
}
} else if req.Method != http.MethodGet {
} else {
if save, resp.Body, err = drainBody(resp.Body); err == nil {
err = dump(save, bld)
}