pwsm / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

HEAD requests with redirects become GETs #304

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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

Original issue reported on code.google.com by songtao...@gmail.com on 13 Jan 2014 at 9:22