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

adds other compression types of encoding #496

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/apig_wsgi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ def _should_send_binary(self) -> bool:

content_encoding = self._get_content_encoding()
# Content type is non-binary but the content encoding might be.
return "gzip" in content_encoding.lower()
is_binary_content = any(
compression in content_encoding.lower()
for compression in ["gzip", "deflate", "br", "zstd"]
)
return is_binary_content

def _get_content_type(self) -> str:
return self._get_header("content-type") or ""
Expand Down