Skip to content
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

Open
wants to merge 1 commit into
base: kjames/fix-auth-aiohttp-compat
Choose a base branch
from

Conversation

TheKevJames
Copy link
Member

Summary

Blocked on #717

@@ -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}:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if 'accept-encoding' not in {k.lower() for k in headers}:
if 'accept-encoding' in {k.lower() for k in headers}:

Copy link
Contributor

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.

Copy link
Contributor

@eddiedialpad eddiedialpad left a 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}:
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants