-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
TooManyRedirects not working in 2.4.0 #2207
Comments
Hurrah! As I predicted in #2095, our redirect cache has introduced a bug. Specifically, if a website sets a permanent redirect to itself we will spin in an infinite loop forever on line 535 of My proposed fix would be to change the logic where we add to the redirect cache (L138 of if resp.is_permanent_redirect:
self.redirect_cache[req.url] = prepared_request.url to this: # Cache the URL unless it's a redirect to self.
if resp._is_permanent_redirect and req.url != prepared_request.url:
self.redirect_cache[req.url] = prepared_request.url |
Don't be too happy @Lukasa. =P |
Merged
Lukasa
added a commit
that referenced
this issue
Sep 9, 2014
ContinuousFunction
pushed a commit
to ContinuousFunction/requests
that referenced
this issue
Nov 14, 2014
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
hi,
if i try page which has permanent redirect to it self, requests (2.4.0) cant raise TooManyRedirects exception. In 2.3.0 works fine.
try:
The text was updated successfully, but these errors were encountered: