diff --git a/discord/http.py b/discord/http.py index a073f91c1..7d9fe661b 100644 --- a/discord/http.py +++ b/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: