Export to GitHub

httplib2 - issue #304

HEAD requests with redirects become GETs


Posted on Jan 13, 2014 by Quick Panda

What steps will reproduce the problem? import httplib2 h = httplib2.Http() head, content = h.request('http://baike.baidu.com/search/word?word=北京&pic=1&sug=1&enc=utf8',method='HEAD', headers={'accept-encoding': 'gzip'}) print len(content) What is the expected output? What do you see instead? I expect a zero-length result I see the length of body

What version of the product are you using? On what operating system? 0.8

Please provide any additional information below. In init.py, I change line 1365,then worked: 1364 if response.status in [302, 303]: 1365 #redirect_method = "GET" redirect_method = method 1366 body = None

Status: New

Labels:
Type-Defect Priority-Medium