Browse Source

Remove useless Host header

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

8
discord/http.py

@ -634,12 +634,7 @@ class HTTPClient:
self._started = True self._started = True
async def ws_connect( async def ws_connect(self, url: str, *, compress: int = 0) -> aiohttp.ClientWebSocketResponse:
self, url: str, *, compress: int = 0, host: Optional[str] = None
) -> aiohttp.ClientWebSocketResponse:
if not host:
host = url[6:].split('?')[0].rstrip('/') # Removes 'wss://' and the query params
kwargs: Dict[str, Any] = { kwargs: Dict[str, Any] = {
'proxy_auth': self.proxy_auth, 'proxy_auth': self.proxy_auth,
'proxy': self.proxy, 'proxy': self.proxy,
@ -650,7 +645,6 @@ class HTTPClient:
'Accept-Language': 'en-US', 'Accept-Language': 'en-US',
'Cache-Control': 'no-cache', 'Cache-Control': 'no-cache',
'Connection': 'Upgrade', 'Connection': 'Upgrade',
'Host': host,
'Origin': 'https://discord.com', 'Origin': 'https://discord.com',
'Pragma': 'no-cache', 'Pragma': 'no-cache',
'Sec-WebSocket-Extensions': 'permessage-deflate; client_max_window_bits', 'Sec-WebSocket-Extensions': 'permessage-deflate; client_max_window_bits',

Loading…
Cancel
Save