diff --git a/src/base.js b/src/base.js index 2b387b6..5cc47d6 100644 --- a/src/base.js +++ b/src/base.js @@ -854,7 +854,7 @@ class Base { return download.getBufferAndType(avatarUrl).then(({buffer, type})=> { let opts = { name: path.basename(avatarUrl), - type: type.split(';')[0], + type, rawResponse: false }; return client.uploadContent(buffer, opts); diff --git a/src/utils.js b/src/utils.js index cf83645..2eba4a8 100644 --- a/src/utils.js +++ b/src/utils.js @@ -36,6 +36,7 @@ const downloadGetBufferAndType = url => { } else { type = mime.lookup(urlParse(url).pathname); } + type = type.split(';')[0]; return { buffer, type }; }); };