Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitswap/httpnet: do not follow redirects #878

Merged
merged 2 commits into from
Mar 12, 2025
Merged

Conversation

hsanjuan
Copy link
Contributor

Avoid following redirects. We treat them as an incorrect provider record. We don't want to be coerced into opening new connections to new hosts and we prefer provider records to be up to date rather than them relying in redirects being followed. There are also problems with potential loops etc.

#862

Avoid following redirects. We treat them as an incorrect provider record.  We
don't want to be coerced into opening new connections to new hosts and we
prefer provider records to be up to date rather than them relying in redirects
being followed. There are also problems with potential loops etc.

#862
@hsanjuan hsanjuan requested a review from a team as a code owner March 10, 2025 15:38
"The default HTTP client's Transport may not reuse HTTP/1.x "keep-alive" TCP connections if the Body is not read to completion and closed."
@hsanjuan
Copy link
Contributor Author

Actually closing the body only matters for HTTP/1. I deployed this and I don't see any perf improvement, if anything perf is worse...

@gammazero gammazero merged commit d7e2dc8 into main Mar 12, 2025
13 checks passed
@gammazero gammazero deleted the httpnet-disable-redirects branch March 12, 2025 01:08
@hsanjuan
Copy link
Contributor Author

Note: I deployed on the other staging box and perf remained the same, meaning no perf impact, differences can be attributed to the local machines.

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

Successfully merging this pull request may close these issues.

3 participants