[httplib2] push by joe.gregorio - Fixes issue 19. Set Content-location on redirected HEAD requests on 2011-06-13 17:42 GMT

1 view
Skip to first unread message

codesite...@google.com

unread,
Jun 13, 2011, 2:42:51 PM6/13/11
to httplib...@googlegroups.com
Revision: dbdc3cf71240
Author: Joe Gregorio <jcgre...@google.com>
Date: Mon Jun 13 10:42:08 2011
Log: Fixes issue 19. Set Content-location on redirected HEAD requests
http://code.google.com/p/httplib2/source/detail?r=dbdc3cf71240

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

=======================================
--- /python2/httplib2/__init__.py Mon Jun 13 10:31:25 2011
+++ /python2/httplib2/__init__.py Mon Jun 13 10:42:08 2011
@@ -1236,7 +1236,7 @@
response.previous = old_response
else:
raise RedirectLimit("Redirected more times than
rediection_limit allows.", response, content)
- elif response.status in [200, 203] and method == "GET":
+ elif response.status in [200, 203] and method in
["GET", "HEAD"]:
# Don't cache 206's since we aren't going to handle byte
range requests
if not response.has_key('content-location'):
response['content-location'] = absolute_uri
=======================================
--- /python3/httplib2/__init__.py Mon Jun 13 10:31:25 2011
+++ /python3/httplib2/__init__.py Mon Jun 13 10:42:08 2011
@@ -979,7 +979,7 @@
response.previous = old_response
else:
raise RedirectLimit("Redirected more times than
redirection_limit allows.", response, content)
- elif response.status in [200, 203] and method == "GET":
+ elif response.status in [200, 203] and method in
["GET", "HEAD"]:
# Don't cache 206's since we aren't going to handle byte
range requests
if 'content-location' not in response:
response['content-location'] = absolute_uri

Reply all
Reply to author
Forward
0 new messages