mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #998 from jamshid/master
Issue #996 Location should not be followed unless 30X response
This commit is contained in:
+1
-1
@@ -233,7 +233,7 @@ class Request(object):
|
||||
|
||||
if r.status_code in REDIRECT_STATI and not self.redirect:
|
||||
|
||||
while (('location' in r.headers) and
|
||||
while (('location' in r.headers and r.status_code in REDIRECT_STATI) and
|
||||
((r.status_code is codes.see_other) or (self.allow_redirects))):
|
||||
|
||||
r.content # Consume socket so it can be released
|
||||
|
||||
Reference in New Issue
Block a user