Skip to content

Handle 3xx redirects differently when streaming with Httpx#100

Merged
janko merged 1 commit intojanko:masterfrom
artrybalko:httpx-streaming-with-redirects
Feb 23, 2026
Merged

Handle 3xx redirects differently when streaming with Httpx#100
janko merged 1 commit intojanko:masterfrom
artrybalko:httpx-streaming-with-redirects

Conversation

@artrybalko
Copy link
Contributor

@artrybalko artrybalko commented Aug 1, 2025

Currently response status is checked for 3xx before HTTPX has a chance to follow redirects.

Proposed fix removes 3xx statuses from the response_error! method and instead proceeds with reading chunks. HTTPX documentation suggests skipping chunks while the redirects are followed. It doesn't raise an error if the maximum allowed number of redirects has been followed so we need to raise Down::TooManyRedirects if after reading all the chunks the status is still 3xx.

Proposed fix for this issue #101

@janko
Copy link
Owner

janko commented Feb 23, 2026

Looks good, thanks!

@janko janko merged commit b307721 into janko:master Feb 23, 2026
0 of 10 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.

2 participants