Skip to content

Commit c6bfd12

Browse files
committed
fix: use gzip instead of deflate
semaphore currently has a bug where it would break on deflate encoding (actix-web expects raw deflate encoding instead of the zlib-wrapped variant mandated by the HTTP spec) Since no other SDK uses deflate, let's just use gzip like everybody else
1 parent 9303992 commit c6bfd12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentry_sdk/transport.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import print_function
22

33
import json
4-
import zlib
4+
import gzip
55
import urllib3
66
import logging
77
import threading
@@ -41,15 +41,15 @@ def _make_pool(dsn, http_proxy, https_proxy):
4141

4242

4343
def send_event(pool, event, auth):
44-
body = zlib.compress(json.dumps(event).encode("utf-8"))
44+
body = gzip.compress(json.dumps(event).encode("utf-8"))
4545
response = pool.request(
4646
"POST",
4747
str(auth.store_api_url),
4848
body=body,
4949
headers={
5050
"X-Sentry-Auth": str(auth.to_header()),
5151
"Content-Type": "application/json",
52-
"Content-Encoding": "deflate",
52+
"Content-Encoding": "gzip",
5353
},
5454
)
5555
try:

0 commit comments

Comments
 (0)