Skip to content

Commit acb5c6d

Browse files
committed
Fix info api fetching
1 parent a678bc2 commit acb5c6d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

discord/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ async def default(
16551655
"""Creates a new :class:`Headers` instance using the default fetching mechanisms."""
16561656
try:
16571657
properties, encoded = await asyncio.wait_for(
1658-
cls.get_api_properties(session, 'info', proxy=proxy, proxy_auth=proxy_auth), timeout=3
1658+
cls.get_api_properties(session, 'web', proxy=proxy, proxy_auth=proxy_auth), timeout=3
16591659
)
16601660
except Exception:
16611661
_log.info('Info API temporarily down. Falling back to manual retrieval...')
@@ -1721,9 +1721,10 @@ async def get_api_properties(
17211721
session: ClientSession, type: str, *, proxy: Optional[str] = None, proxy_auth: Optional[BasicAuth] = None
17221722
) -> Tuple[Dict[str, Any], str]:
17231723
"""Fetches client properties from the API."""
1724-
async with session.get(
1724+
async with session.post(
17251725
f'https://cordapi.dolfi.es/api/v2/properties/{type}', proxy=proxy, proxy_auth=proxy_auth
17261726
) as resp:
1727+
resp.raise_for_status()
17271728
json = await resp.json()
17281729
return json['properties'], json['encoded']
17291730

0 commit comments

Comments
 (0)