Skip to content

Commit

Permalink
chore: Compress (gzip) request if server support it - PR
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykGala committed Oct 4, 2023
1 parent 45265f6 commit 5a81fd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/neptune/internal/backends/hosted_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@


class GzipAdapter(HTTPAdapter):
def send(self, request: PreparedRequest, stream=False, **kw) -> Response:
def send(self, request: PreparedRequest, stream: bool = False, **kw) -> Response:
if request.body is not None and not stream and request.headers.get("Content-Type", None) == "application/json":
request_body = request.body if isinstance(request.body, bytes) else bytes(request.body, "utf-8")
gzip_compress = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, zlib.MAX_WBITS | 16)
Expand Down

0 comments on commit 5a81fd1

Please sign in to comment.