eshad / httplib2

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

httplib2 will try to unzip even if Accept-Encoding: identity #107

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Set headers={'accept-encoding': 'identity'} if you know server will send 
uncompressed content
2. Server sends uncompressed content, but might send "Content-Encoding: gzip" 
along
3. httplib2 does not honor that you told it that it now only has to accept 
uncompressed content and still tries to unzip

I expect it to not only look at the Content-Encoding header that it receives, 
but rather at the non-default Accept-Encoding that was set. It makes little 
sense that you tell it otherwise (just accept uncompressed stuff), but in the 
end it does what the responding server suggests.

Original issue reported on code.google.com by julian....@gmail.com on 2 Aug 2010 at 7:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Added patch with suggested change.

Original comment by julian....@gmail.com on 3 Aug 2010 at 5:38

Attachments:

GoogleCodeExporter commented 9 years ago
If the response header says the content is encoded in gzip of deflate then it 
will decompress it.  This isn't a bug in httplib2, but a bug in the server that 
is sending compressed content when you explicitly asked it not to.

Original comment by joe.gregorio@gmail.com on 14 Feb 2011 at 4:02

GoogleCodeExporter commented 9 years ago
But, if you want httplib2 to act as if it has no decompression capability.. 
there is no other way!

Original comment by julian....@gmail.com on 16 Mar 2011 at 2:14