Skip to content

fix(fasthttp,fiber): correctly capture request body on scope#1284

Merged
giortzisg merged 1 commit into
masterfrom
fix/fast-body
Apr 27, 2026
Merged

fix(fasthttp,fiber): correctly capture request body on scope#1284
giortzisg merged 1 commit into
masterfrom
fix/fast-body

Conversation

@giortzisg

@giortzisg giortzisg commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Description

These integrations don't re-read r.Body, so the io.TeeReader trick in SetRequest is never used. SetRequestBody is required to capture the body. This changes behavior to drop the redundant r.Body wiring in convert() (which sets a TeeReader that immediately gets overwritten by SetRequestBody) and copies the bytes via bytes.Clone, since fasthttp recycles the body buffer between requests.

Issues

  • resolves: SDK-1185
Changelog Entry Instructions

To add a custom changelog entry, uncomment the section above. Supports:

  • Single entry: just write text
  • Multiple entries: use bullet points
  • Nested bullets: indent 4+ spaces

For more details: custom changelog entries

Reminders

Changelog Entry

  • Correctly capture request body for fasthttp and fiber

These integrations don't re-read r.Body, so the io.TeeReader trick in
SetRequest is never used. SetRequestBody is required to capture the
body. This changes behavior to drop the redundant r.Body wiring in
convert() (which sets a TeeReader that immediately gets overwritten by
SetRequestBody) and copies the bytes via bytes.Clone, since fasthttp
recycles the body buffer between requests.
@giortzisg giortzisg requested a review from Litarnus April 27, 2026 12:33
@giortzisg giortzisg self-assigned this Apr 27, 2026
@giortzisg giortzisg merged commit bd20df0 into master Apr 27, 2026
16 checks passed
@giortzisg giortzisg deleted the fix/fast-body branch April 27, 2026 14:20
@linear-code

linear-code Bot commented Apr 28, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants