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
Add maxRedirects
option
#838
Comments
How many redirects are you trying to follow and in what crazy situation would it be more than 10? |
I am using it for a web-scraping and in some cases like for example on TripAdvisor, they have more redirects than ten. I think it might be connected that the request is redirected through a lot of bot check servers. In comparison, Chrome browser uses 20 redirects. I guess it is an edge use case that most of |
Will 20 be enough for you? |
The point of the limitation is to prevent infinite loops, not valid use-cases. I would also prefer not to make it configurable as everything that is configurable adds extra overhead for the maintainers and also for users having to read the docs. |
20 would be great. I will create a PR for it. Thank you very much 👍 |
I would much rather have a default low, e.g. 2 redirects and This is simply because 99% of websites will never make more than 1-2 redirects at a time. We are using Got to aggregate data from thousands of websites. If one of them started to redirect in loop (e.g. broken session) and we had 50 jobs running, then 20x50 could easily result in some service disruption. That said, we already don't use |
I agree with @gajus IMHO it should be configurable and we should detect infinite loops immediately without reaching the limit. |
That is unfortunately impossible. There are cases where services are going to redirect back and forth while waiting for something to happen. |
Alright. Let's leave the default at 10 and expose an option for this. |
What problem are you trying to solve?
I am trying to follow more than 10 redirects.
Describe the feature
The configurable property, that will override the hardcoded 10.
The text was updated successfully, but these errors were encountered: