aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-01-29 00:25:54 -0500
committerRapptz <[email protected]>2016-01-29 00:25:54 -0500
commite2c9cb7f8e474ec604dd7269aa96ea5b8021ff0f (patch)
treeee8f1a295dce45cc5414aabe26c53d931f7131b3
parent[commands] Context.invoke will now return what the command returns. (diff)
downloaddiscord.py-e2c9cb7f8e474ec604dd7269aa96ea5b8021ff0f.tar.xz
discord.py-e2c9cb7f8e474ec604dd7269aa96ea5b8021ff0f.zip
Force content-type for file uploads.
-rw-r--r--discord/client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index 2b3ab45a..40713751 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -1042,10 +1042,10 @@ class Client:
try:
# attempt to open the file and send the request
with open(fp, 'rb') as f:
- files.add_field('file', f, filename=filename)
+ files.add_field('file', f, filename=filename, content_type='application/octet-stream')
response = yield from aiohttp.post(url, data=files, headers=headers, loop=self.loop)
except TypeError:
- files.add_field('file', fp, filename=filename)
+ files.add_field('file', fp, filename=filename, content_type='application/octet-stream')
response = yield from aiohttp.post(url, data=files, headers=headers, loop=self.loop)
log.debug(request_logging_format.format(method='POST', response=response))