mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 02:08:25 +00:00
Better detection for Cloudflare related 429s.
At some point Cloudflare started returning some JSON. I don't know how this JSON looks like. See #2544
This commit is contained in:
@ -179,7 +179,7 @@ class HTTPClient:
|
||||
|
||||
# we are being rate limited
|
||||
if r.status == 429:
|
||||
if not isinstance(data, dict):
|
||||
if not r.headers.get('Via'):
|
||||
# Banned by Cloudflare more than likely.
|
||||
raise HTTPException(r, data)
|
||||
|
||||
|
Reference in New Issue
Block a user