Skip to content

Drain redirect bodies without buffering, NEWS for #980 - #991

Merged
benoitc merged 1 commit into
masterfrom
chore/max-body-followup
Oct 25, 2026
Merged

benoitc merged 1 commit into
masterfrom
chore/max-body-followup

Conversation

@benoitc

@benoitc benoitc commented Oct 25, 2026

Copy link
Copy Markdown
Owner

When an async request hits a redirect, hackney skips the redirect's body. It did so by reading the whole body into memory; since #980 that read also stops at max_body_size and leaves the rest of the body unread on the connection. The body is now dropped chunk by chunk, with no memory cost and no cap.

The 512 MiB default is defined once in hackney.hrl instead of in both hackney_conn and hackney_h3, and NEWS gets the #980 entry. No behaviour change beyond the redirect drain.

Skipping a redirect body on the async path read it whole, so it held the
body in memory and, since #980, stopped at max_body_size with the rest
left unread. It now drops chunks as they arrive. The 512 MiB default is
defined once in hackney.hrl.
@benoitc
benoitc merged commit 8e0d910 into master Oct 25, 2026
6 checks passed
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.

1 participant