Skip to content

Commit 21bd3cd

Browse files
authored
fix: Add zlib-stream compression in accordance with #1071 (#1072)
* fix: Added zlib + compression, disabled msg size limit * fix: Removed `$` on identify call for future-proofing. * fix: Add zlib-stream compression in accordance with #1071
1 parent fc5f292 commit 21bd3cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

interactions/api/http/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ async def get_gateway(self) -> str:
8181
Route("GET", "/gateway")
8282
) # typehinting Any because pycharm yells
8383
try:
84-
_url = f'{url["url"]}?v=10&encoding=json'
84+
_url = f'{url["url"]}?v=10&encoding=json&compress=zlib-stream'
8585
except TypeError: # seen a few times
86-
_url = "wss://gateway.discord.gg?v=10&encoding=json"
86+
_url = "wss://gateway.discord.gg?v=10&encoding=json&compress=zlib-stream"
8787
return _url
8888

8989
async def get_bot_gateway(self) -> Tuple[int, str]:
@@ -95,9 +95,9 @@ async def get_bot_gateway(self) -> Tuple[int, str]:
9595

9696
data: Any = await self._req.request(Route("GET", "/gateway/bot"))
9797
try:
98-
_url = f'{data["url"]}?v=10&encoding=json'
98+
_url = f'{data["url"]}?v=10&encoding=json&compress=zlib-stream'
9999
except TypeError: # seen a few times
100-
_url = "wss://gateway.discord.gg?v=10&encoding=json"
100+
_url = "wss://gateway.discord.gg?v=10&encoding=json&compress=zlib-stream"
101101
return data["shards"], _url
102102

103103
async def login(self) -> Optional[dict]:

0 commit comments

Comments
 (0)