Skip to content

Commit

Permalink
fix: url validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jrCleber committed Nov 1, 2024
1 parent c2f96e2 commit 0fadae0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/whatsapp/services/whatsapp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,9 @@ export class WAStartupService {

let ext = mediaMessage.extension;

if (['http', 'https'].includes(mediaMessage.media as string)) {
const isURL = /http(s?):\/\//.test(mediaMessage.media as string);

if (isURL) {
const response = await axios.get(mediaMessage.media as string, {
responseType: 'arraybuffer',
});
Expand Down

0 comments on commit 0fadae0

Please sign in to comment.