File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55* Fixed Lid Messages
66* Fixed sending variables to typebot
77* Fixed sending variables from typebot
8+ * Correction sending s3/minio media to chatwoot and typebot
89
910# 1.6.0 (2023-12-12 17:24)
1011
Original file line number Diff line number Diff line change @@ -920,7 +920,11 @@ export class ChatwootService {
920920 const fileName = decodeURIComponent ( parts [ parts . length - 1 ] ) ;
921921 this . logger . verbose ( 'file name: ' + fileName ) ;
922922
923- const mimeType = mimeTypes . lookup ( fileName ) . toString ( ) ;
923+ const response = await axios . get ( media , {
924+ responseType : 'arraybuffer' ,
925+ } ) ;
926+
927+ const mimeType = response . headers [ 'content-type' ] ;
924928 this . logger . verbose ( 'mime type: ' + mimeType ) ;
925929
926930 let type = 'document' ;
Original file line number Diff line number Diff line change @@ -2689,7 +2689,9 @@ export class WAStartupService {
26892689 mimetype = mediaMessage . mimetype ;
26902690 } else {
26912691 if ( isURL ( mediaMessage . media ) ) {
2692- mimetype = getMIMEType ( mediaMessage . media ) ;
2692+ const response = await axios . get ( mediaMessage . media , { responseType : 'arraybuffer' } ) ;
2693+
2694+ mimetype = response . headers [ 'content-type' ] ;
26932695 } else {
26942696 mimetype = getMIMEType ( mediaMessage . fileName ) ;
26952697 }
You can’t perform that action at this time.
0 commit comments