Re: Issue 19 in httplib2: Content-Location not set after redirect with HEAD requests

5 views
Skip to first unread message

codesite...@google.com

unread,
Jan 4, 2011, 12:28:42 AM1/4/11
to httplib...@googlegroups.com

Comment #1 on issue 19 by joshsegall: Content-Location not set after
redirect with HEAD requests
http://code.google.com/p/httplib2/issues/detail?id=19

This is a problem for me too, but the workaround of using resp.previous
seems to work for now (thanks!).

The behavior I see is that 'content-location' is sometimes set and
sometimes not, but I haven't determined a pattern yet.

codesite...@google.com

unread,
Mar 30, 2011, 11:56:52 AM3/30/11
to httplib...@googlegroups.com

Comment #2 on issue 19 by umb...@gmail.com: Content-Location not set after

Just a +1 here, I ran into this issue as well.

codesite...@google.com

unread,
Mar 30, 2011, 12:00:53 PM3/30/11
to httplib...@googlegroups.com

Comment #3 on issue 19 by umb...@gmail.com: Content-Location not set after

If I'm not mistaken the fix for this should be very simple, in init.py
these lines:

elif response.status in [200, 203] and method == "GET":
# 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

Just need to change to this:

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

codesite...@google.com

unread,
Jun 13, 2011, 2:46:54 PM6/13/11
to httplib...@googlegroups.com
Updates:
Status: Fixed

Comment #4 on issue 19 by joe.gregorio: Content-Location not set after

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages