[httplib2] push by joe.gregorio - Redirect with a GET on 302 regardless of the originating method. Fixes... on 2011-06-13 17:31 GMT

1 view
Skip to first unread message

codesite...@google.com

unread,
Jun 13, 2011, 2:30:20 PM6/13/11
to httplib...@googlegroups.com
Revision: 10586b0a5ab0
Author: Joe Gregorio <jcgre...@google.com>
Date: Mon Jun 13 10:31:25 2011
Log: Redirect with a GET on 302 regardless of the originating method.
Fixes issue 139.
http://code.google.com/p/httplib2/source/detail?r=10586b0a5ab0

Modified:
/python2/httplib2/__init__.py
/python3/httplib2/__init__.py

=======================================
--- /python2/httplib2/__init__.py Mon Jun 13 10:09:20 2011
+++ /python2/httplib2/__init__.py Mon Jun 13 10:31:25 2011
@@ -1230,7 +1230,7 @@
if not old_response.has_key('content-location'):
old_response['content-location'] = absolute_uri
redirect_method = method
- if response.status == 303:
+ if response.status in [302, 303]:
redirect_method = "GET"
(response, content) = self.request(location,
redirect_method, body=body, headers = headers, redirections = redirections
- 1)
response.previous = old_response
=======================================
--- /python3/httplib2/__init__.py Mon Jun 13 10:09:20 2011
+++ /python3/httplib2/__init__.py Mon Jun 13 10:31:25 2011
@@ -973,7 +973,7 @@
if 'content-location' not in old_response:
old_response['content-location'] = absolute_uri
redirect_method = method
- if response.status == 303:
+ if response.status in [302, 303]:
redirect_method = "GET"
(response, content) = self.request(location,
redirect_method, body=body, headers = headers, redirections = redirections
- 1)
response.previous = old_response

Reply all
Reply to author
Forward
0 new messages