-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(storage): avoid stomping over session-level auto_decompress value #718
base: kjames/fix-auth-aiohttp-compat
Are you sure you want to change the base?
fix(storage): avoid stomping over session-level auto_decompress value #718
Conversation
@@ -591,12 +591,14 @@ async def _download( | |||
# aiohttp and requests automatically decompress the body if this | |||
# argument is not passed. We assume that if the Accept-Encoding header | |||
# is present, then the client will handle the decompression | |||
auto_decompress = 'accept-encoding' not in {k.lower() for k in headers} | |||
auto_decompress = None # inherit the Session default setting | |||
if 'accept-encoding' not in {k.lower() for k in headers}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if 'accept-encoding' not in {k.lower() for k in headers}: | |
if 'accept-encoding' in {k.lower() for k in headers}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we want want Kevin has here. If 'accept-encoding' in {k.lower() for k in headers}
is True
, that means that the session passes auto_decompress
value implicitly in session
, and we want None
. We only want to set auto_decompress
if 'accept-encoding' in {k.lower() for k in headers}
is False, that is 'accept-encoding'
is not in the headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved: avoid overriding auto_decompress value
@@ -591,12 +591,14 @@ async def _download( | |||
# aiohttp and requests automatically decompress the body if this | |||
# argument is not passed. We assume that if the Accept-Encoding header | |||
# is present, then the client will handle the decompression | |||
auto_decompress = 'accept-encoding' not in {k.lower() for k in headers} | |||
auto_decompress = None # inherit the Session default setting | |||
if 'accept-encoding' not in {k.lower() for k in headers}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we want want Kevin has here. If 'accept-encoding' in {k.lower() for k in headers}
is True
, that means that the session passes auto_decompress
value implicitly in session
, and we want None
. We only want to set auto_decompress
if 'accept-encoding' in {k.lower() for k in headers}
is False, that is 'accept-encoding'
is not in the headers.
Summary
Blocked on #717