From 47956cd4bcea44dc7e8b55ee52275a9370835366 Mon Sep 17 00:00:00 2001 From: Vincent Dupont Date: Fri, 17 Jul 2026 09:23:33 +0200 Subject: [PATCH] fix(retry): rewind body after print so retry policy can read it --- request.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/request.go b/request.go index 9c5e42e75..03996b9e5 100644 --- a/request.go +++ b/request.go @@ -2495,13 +2495,13 @@ func (r *Request) retryRequest(reqFunc func() (*http.Response, error)) ( if resp != nil { for _, printer := range r.config.Printers { - if resp.Body != nil { - resp.Body.(*bodyWrapper).Rewind() - } // Make a copy to avoid accidental modification of request. // See comment above. httpRespCopy := *resp printer.Response(&httpRespCopy, elapsed) + if resp.Body != nil { + resp.Body.(*bodyWrapper).Rewind() + } } }