fix: correction sending s3/minio media to chatwoot and typebot

This commit is contained in:
Davidson Gomes
2023-12-14 11:50:05 -03:00
parent a44646161b
commit 20fb66e2f7
3 changed files with 9 additions and 2 deletions

View File

@@ -2689,7 +2689,9 @@ export class WAStartupService {
mimetype = mediaMessage.mimetype;
} else {
if (isURL(mediaMessage.media)) {
mimetype = getMIMEType(mediaMessage.media);
const response = await axios.get(mediaMessage.media, { responseType: 'arraybuffer' });
mimetype = response.headers['content-type'];
} else {
mimetype = getMIMEType(mediaMessage.fileName);
}