e027164 tell urllib3 not to decode content when streaming

Authored and Committed by Dan Callaghan 6 years ago
    tell urllib3 not to decode content when streaming
    
    In some cases, repodata files like primary.xml.gz are served up with
    Content-Encoding: gzip in their HTTP headers. By default, requests will
    honour this header and do gzip decoding for us, meaning that we will end
    up saving the *uncompressed* XML into our cache. We really want to just
    save the raw bytes exactly as they exist on the server instead, and let
    libsolv decode them upon read, since that is how librepo/dnf does it.
    
    There's no way to do that with requests (its .iter_content() method
    hardcodes decode_content=True) so we have to fall back to poking in the
    "raw" urllib3 response directly.
    
    Change-Id: I7c854610c84a0e161298dac087afe2b943563f17
    
        
file modified
+1 -1