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

Log redirects in verbose mode (-vv) #1117

Merged
merged 3 commits into from
Jun 23, 2023
Merged

Log redirects in verbose mode (-vv) #1117

merged 3 commits into from
Jun 23, 2023

Conversation

mre
Copy link
Member

@mre mre commented Jun 20, 2023

This adds a custom redirect policy,
which logs redirects as debug messages.
It can help with troubleshooting, e.g. in situations like #1115.

@oupala fyi

mre and others added 3 commits June 21, 2023 00:03
This adds a custom redirect policy,
which logs redirects as debug messages.
It can help with troubleshooting, e.g. in situations like
#1115
@@ -907,7 +918,7 @@ mod tests {
.await;

let client = ClientBuilder::builder()
.max_redirects(1_usize)
.max_redirects(0_usize)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think the redirect handling was incorrect before. If I set --max-redirects to 0, I expect exactly zero redirects. If I get a redirect, I would count that as an error. I don't know if that's a bug in the default reqwest retry policy handling, or if it's just my misunderstanding of how the algorithm should work.

Code is here: https://docs.rs/reqwest/latest/src/reqwest/redirect.rs.html#131 and it looks fine. 🤔

@mre mre merged commit f0af985 into master Jun 23, 2023
6 checks passed
@mre mre deleted the redirect branch June 23, 2023 13:49
@mre mre added the enhancement New feature or request label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant