-
Notifications
You must be signed in to change notification settings - Fork 53
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
Redirect Plugin - max
option
#249
Comments
max_redirects
optionmax
option
thanks for the report. you are right, we should allow to limit redirects. i had a look at the code (expecting to point you to where we define the limit) but actually we don't have it 😱 we have a limit in the retry plugin but not in redirect plugin. we do have a cyclic redirection detection in the plugin. i would be happy if you can add the functionality. to be strictly backwards compatible, lets have a default value of |
After posting this, I found that the Since this works, do you think we still need a
|
ah right, that was the reason why we did not already do this 🙈 imo thats good enough. other things can cause a restart, which makes that limit less exact than a limit on the retry plugin itself. but the limits are protection against accidents / malicous actors and people should not expect to regularly go to exactly the limit of redirects i'd say. the doc mentions max in the intro - if you want to add a line after the additionally, adding a note to the RedirectPlugin constructor in the same vein would help people who look directly at the code. |
Description
Looking at the docs/code, I don't see a way to define the number of maximum redirects to follow (similar to
allow_redirects.max
in Guzzle). This seems like a good security measure to have. There seems to be circulation redirects detection, but there could be a website redirecting from/1
->/2
-> ... infinitely, causing essentially an infinite loop.Example
Additional context
I'm happy to work on the PR if the idea is accepted.
The text was updated successfully, but these errors were encountered: