Browse Source
Set socket family of connector to AF_INET
- discord doesn't support ipv6
- prevents issues with hosts with DNS64 enabled
- resolves #9442
pull/9445/head
Michael H
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
discord/http.py
|
@ -48,6 +48,7 @@ from typing import ( |
|
|
from urllib.parse import quote as _uriquote |
|
|
from urllib.parse import quote as _uriquote |
|
|
from collections import deque |
|
|
from collections import deque |
|
|
import datetime |
|
|
import datetime |
|
|
|
|
|
import socket |
|
|
|
|
|
|
|
|
import aiohttp |
|
|
import aiohttp |
|
|
|
|
|
|
|
@ -784,7 +785,8 @@ class HTTPClient: |
|
|
async def static_login(self, token: str) -> user.User: |
|
|
async def static_login(self, token: str) -> user.User: |
|
|
# Necessary to get aiohttp to stop complaining about session creation |
|
|
# Necessary to get aiohttp to stop complaining about session creation |
|
|
if self.connector is MISSING: |
|
|
if self.connector is MISSING: |
|
|
self.connector = aiohttp.TCPConnector(limit=0) |
|
|
# discord does not support ipv6 |
|
|
|
|
|
self.connector = aiohttp.TCPConnector(limit=0, family=socket.AF_INET) |
|
|
|
|
|
|
|
|
self.__session = aiohttp.ClientSession( |
|
|
self.__session = aiohttp.ClientSession( |
|
|
connector=self.connector, |
|
|
connector=self.connector, |
|
|