Skip to content

Commit d4ee311

Browse files
committed
fix(storage): fixup inverted logic in previous features
1 parent f53d80f commit d4ee311

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

storage/gcloud/aio/storage/storage.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,9 @@ async def _download(
625625
# argument is not passed, unless a user has explicitly disabled that
626626
# option at the session level in the case of aiohttp. We follow the
627627
# user setting by default (by passing None) and only explicitly disable
628-
# it when we know that the object is not compressed (when the
629-
# Accept-Encoding header is missing).
628+
# it when a caller explicitly requests a compressed payload.
630629
auto_decompress = None
631-
if 'accept-encoding' not in {k.lower() for k in headers}:
630+
if 'accept-encoding' in {k.lower() for k in headers}:
632631
auto_decompress = False
633632

634633
s = AioSession(session) if session else self.session
@@ -675,10 +674,9 @@ async def _download_stream(
675674
# argument is not passed, unless a user has explicitly disabled that
676675
# option at the session level in the case of aiohttp. We follow the
677676
# user setting by default (by passing None) and only explicitly disable
678-
# it when we know that the object is not compressed (when the
679-
# Accept-Encoding header is missing).
677+
# it when a caller explicitly requests a compressed payload.
680678
auto_decompress = None
681-
if 'accept-encoding' not in {k.lower() for k in headers}:
679+
if 'accept-encoding' in {k.lower() for k in headers}:
682680
auto_decompress = False
683681

684682
s = AioSession(session) if session else self.session

0 commit comments

Comments
 (0)