fix media type

This commit is contained in:
cutestnekoaqua 2023-03-02 19:10:41 +01:00
parent 0c9b10f307
commit 2b2eab07cc
No known key found for this signature in database
GPG key ID: 6BF0964A5069C1E0

View file

@ -1293,7 +1293,10 @@ export default class Misskey implements MegalodonInterface {
*/
public async uploadMedia(file: any, _options?: { description?: string; focus?: string }): Promise<Response<Entity.Attachment>> {
const formData = new FormData()
formData.append('file', file)
formData.append('file', file.buffer, {
contentType: file.mimetype,
filename: file.originalname,
})
let headers: { [key: string]: string } = {}
if (typeof formData.getHeaders === 'function') {
headers = formData.getHeaders()