Sherlock
6 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
1 deletions
-
discord/http.py
|
|
@ -777,7 +777,15 @@ class HTTPClient: |
|
|
|
raise RuntimeError('Unreachable code in HTTP handling') |
|
|
|
|
|
|
|
async def get_from_cdn(self, url: str) -> bytes: |
|
|
|
async with self.__session.get(url) as resp: |
|
|
|
kwargs = {} |
|
|
|
|
|
|
|
# Proxy support |
|
|
|
if self.proxy is not None: |
|
|
|
kwargs['proxy'] = self.proxy |
|
|
|
if self.proxy_auth is not None: |
|
|
|
kwargs['proxy_auth'] = self.proxy_auth |
|
|
|
|
|
|
|
async with self.__session.get(url, **kwargs) as resp: |
|
|
|
if resp.status == 200: |
|
|
|
return await resp.read() |
|
|
|
elif resp.status == 404: |
|
|
|