mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
fix: correction sending s3/minio media to chatwoot and typebot
This commit is contained in:
parent
a44646161b
commit
20fb66e2f7
@ -5,6 +5,7 @@
|
|||||||
* Fixed Lid Messages
|
* Fixed Lid Messages
|
||||||
* Fixed sending variables to typebot
|
* Fixed sending variables to typebot
|
||||||
* Fixed sending variables from typebot
|
* Fixed sending variables from typebot
|
||||||
|
* Correction sending s3/minio media to chatwoot and typebot
|
||||||
|
|
||||||
# 1.6.0 (2023-12-12 17:24)
|
# 1.6.0 (2023-12-12 17:24)
|
||||||
|
|
||||||
|
@ -920,7 +920,11 @@ export class ChatwootService {
|
|||||||
const fileName = decodeURIComponent(parts[parts.length - 1]);
|
const fileName = decodeURIComponent(parts[parts.length - 1]);
|
||||||
this.logger.verbose('file name: ' + fileName);
|
this.logger.verbose('file name: ' + fileName);
|
||||||
|
|
||||||
const mimeType = mimeTypes.lookup(fileName).toString();
|
const response = await axios.get(media, {
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
});
|
||||||
|
|
||||||
|
const mimeType = response.headers['content-type'];
|
||||||
this.logger.verbose('mime type: ' + mimeType);
|
this.logger.verbose('mime type: ' + mimeType);
|
||||||
|
|
||||||
let type = 'document';
|
let type = 'document';
|
||||||
|
@ -2689,7 +2689,9 @@ export class WAStartupService {
|
|||||||
mimetype = mediaMessage.mimetype;
|
mimetype = mediaMessage.mimetype;
|
||||||
} else {
|
} else {
|
||||||
if (isURL(mediaMessage.media)) {
|
if (isURL(mediaMessage.media)) {
|
||||||
mimetype = getMIMEType(mediaMessage.media);
|
const response = await axios.get(mediaMessage.media, { responseType: 'arraybuffer' });
|
||||||
|
|
||||||
|
mimetype = response.headers['content-type'];
|
||||||
} else {
|
} else {
|
||||||
mimetype = getMIMEType(mediaMessage.fileName);
|
mimetype = getMIMEType(mediaMessage.fileName);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user