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.
Just a +1 here, I ran into this issue as well.
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
Comment #4 on issue 19 by joe.gregorio: Content-Location not set after
redirect with HEAD requests
http://code.google.com/p/httplib2/issues/detail?id=19
(No comment was entered for this change.)