Skip to content
Snippets Groups Projects
Commit 9f187c9d authored by Antoine Lambert's avatar Antoine Lambert
Browse files

package/utils: Prevent content automatic deflate in download function

The python requests library automatically deflate downloaded content bytes
if the response header content-encoding is set to a supported encoding.

However some HTTP servers can serve a tarball with content-type set to
application/x-gzip and content-encoding set to gzip which is wrong as
tarball is uncompressed while downloading it.

That behavior can make a file checksum check after download fail as the
expected checksum was computed on the compressed version of the file, not
the uncompressed one.

So ensure to prevent automatic deflate by reading response raw content
instead of using the iter_content method when the content-type and
content-encoding headers are both set to gzip format.
parent 976a5fa4
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment