Skip to content

Conversation

@linyihai
Copy link
Contributor

@linyihai linyihai commented Jun 1, 2025

Motivation

This patch removed the content-type, content-length, content-encoding, transfer-encoding headers in the follow_redirect::poll after the response body is set to empty. This logic works well in reqwest.

Currently, the follow_redirect::poll doesn't remove these header after redirecting, this behavior is a violation of the HTTP/1.1 spec

Also see seanmonstar/reqwest#2705

Solution

Remove the headers before making redirection

@jplatte jplatte requested a review from seanmonstar June 1, 2025 08:59
@seanmonstar seanmonstar merged commit f64fbe6 into tower-rs:main Jun 1, 2025
11 checks passed
@linyihai linyihai deleted the follow-redirect branch June 4, 2025 01:31
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.

3 participants