• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Teamwork / utils / 20765621273 / 1
77%
master: 77%

Build:
Build:
LAST BUILD BRANCH: refs/tags/v2.3.2
DEFAULT BRANCH: master
Ran 06 Jan 2026 11:43PM UTC
Files 27
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Jan 2026 11:41PM UTC coverage: 77.251% (+0.4%) from 76.881%
20765621273.1

push

github

rafaeljusto
Fix request body handling in DoExponentialBackoff

Previously, DoExponentialBackoff relied on Seek to reset request bodies
between retries. This approach failed when bodies didn't implement Seek
or when req.GetBody wasn't set (e.g., manually wrapped io.NopCloser),
causing "ContentLength=N with Body length 0" errors on retry attempts.

The issue occurred because req.Clone() reuses the exhausted body reader
without resetting it, leading to empty bodies on subsequent attempts
while ContentLength remained set from the original request.

Now read the entire request body upfront and create fresh io.Readers
for each retry attempt. This ensures:
- Body is always available for all retry attempts
- ContentLength is correctly set to match the actual body
- Works reliably with all io.Reader types, not just seekable ones

Added test case with io.NopCloser-wrapped bytes.Buffer that validates
both body content and ContentLength matching across retry attempts.

1270 of 1644 relevant lines covered (77.25%)

40.63 hits per line

Source Files on job 20765621273.1
  • Tree
  • List 27
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 20765621273
  • b50b1988 on github
  • Prev Job for on httpx-exp-backoff (#20759133771.1)
  • Next Job for on httpx-exp-backoff (#20765670668.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc