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.
Loading
Please register or sign in to comment