Browse Source

Fix aiohttp patch not working on newer versions

pull/10109/head
dolfies 2 years ago
parent
commit
d9738690f7
  1. 8
      discord/http.py

8
discord/http.py

@ -325,8 +325,12 @@ class MaybeUnlock:
# For some reason, the Discord voice websocket expects this header to be
# completely lowercase while aiohttp respects spec and does it as case-insensitive
aiohttp.hdrs.WEBSOCKET = 'websocket' # type: ignore
# Support brotli if installed
aiohttp.client_reqrep.ClientRequest.DEFAULT_HEADERS[aiohttp.hdrs.ACCEPT_ENCODING] = _gen_accept_encoding_header() # type: ignore
try:
# Support brotli if installed
aiohttp.client_reqrep.ClientRequest.DEFAULT_HEADERS[aiohttp.hdrs.ACCEPT_ENCODING] = _gen_accept_encoding_header() # type: ignore
except Exception:
# aiohttp does it for us anyway
pass
class _FakeResponse:

Loading…
Cancel
Save