aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin <[email protected]>2018-12-21 21:55:16 +0100
committerRapptz <[email protected]>2019-01-28 21:47:23 -0500
commit0614e2af907174a4034b51a36aff2345bc61c9a1 (patch)
tree61243f1ca2d1bbc7c33ef981a68c47dd1a5b8122
parentAllow additional parameters on channel creation (diff)
downloaddiscord.py-0614e2af907174a4034b51a36aff2345bc61c9a1.tar.xz
discord.py-0614e2af907174a4034b51a36aff2345bc61c9a1.zip
Use a tuple for startswith in mime detection code.
-rw-r--r--discord/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/utils.py b/discord/utils.py
index f7a57fab..982b785c 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -250,7 +250,7 @@ def _get_mime_type_for_image(data):
return 'image/png'
elif data.startswith(b'\xFF\xD8') and data.rstrip(b'\0').endswith(b'\xFF\xD9'):
return 'image/jpeg'
- elif data.startswith(b'\x47\x49\x46\x38\x37\x61') or data.startswith(b'\x47\x49\x46\x38\x39\x61'):
+ elif data.startswith((b'\x47\x49\x46\x38\x37\x61', b'\x47\x49\x46\x38\x39\x61')):
return 'image/gif'
elif data.startswith(b'RIFF') and data[8:12] == b'WEBP':
return 'image/webp'