Skip to content
Merged

* #67

Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"

[project]
name = "oapi"
version = "2.8.0"
version = "2.8.1"
description = "A library for generating web API clients from OpenAPI documents"
readme = "README.md"
license = "MIT"
Expand Down
5 changes: 5 additions & 0 deletions src/oapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import threading
import time
import typing
import zlib
from base64 import b64encode
from collections import deque
from dataclasses import dataclass, field
Expand Down Expand Up @@ -764,6 +765,8 @@ def _encode_content(data: bytes, content_encoding: str) -> bytes:
content_encoding = content_encoding.lower().strip()
if content_encoding == "gzip":
data = gzip.compress(data)
elif content_encoding == "deflate":
data = zlib.compress(data)
elif content_encoding == "zstd":
import zstandard # noqa: PLC0415

Expand All @@ -788,6 +791,8 @@ def _decode_content(data: bytes, content_encoding: str) -> bytes:
content_encoding = content_encoding.lower().strip()
if content_encoding == "gzip":
data = gzip.decompress(data)
elif content_encoding == "deflate":
data = zlib.decompress(data)
elif content_encoding == "zstd":
import zstandard # noqa: PLC0415

Expand Down