Skip to content

Commit c2f96e2

Browse files
committed
bug fix: url validation
1 parent 3925ffb commit c2f96e2

3 files changed

Lines changed: 2 additions & 27 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"@types/jsonwebtoken": "^9.0.5",
8787
"@types/mime-types": "^2.1.4",
8888
"@types/multer": "^1.4.12",
89+
"@types/node": "^22.8.6",
8990
"@types/qrcode": "^1.5.5",
9091
"@types/qrcode-terminal": "^0.12.2",
9192
"@types/swagger-ui-express": "^4.1.6",

prisma/schema.prisma

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ model Instance {
5959
Chat Chat[]
6060
Contact Contact[]
6161
Webhook Webhook?
62-
Typebot Typebot?
6362
ActivityLogs ActivityLogs[]
6463
Message Message[]
6564
}
@@ -101,8 +100,6 @@ model Message {
101100
isGroup Boolean? @db.Boolean
102101
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
103102
instanceId Int
104-
TypebotSession TypebotSession? @relation(fields: [typebotSessionId], references: [id], onDelete: Cascade)
105-
typebotSessionId Int?
106103
MessageUpdate MessageUpdate[]
107104
Media Media?
108105
@@ -158,35 +155,12 @@ model Webhook {
158155
instanceId Int @unique
159156
}
160157

161-
model Typebot {
162-
id Int @id @default(autoincrement())
163-
publicId String @db.VarChar(200)
164-
typebotUrl String @db.VarChar(500)
165-
enabled Boolean? @default(true) @db.Boolean
166-
enableGroup Boolean? @default(false) @db.Boolean
167-
createdAt DateTime? @default(now())
168-
updatedAt DateTime? @updatedAt
169-
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
170-
instanceId Int @unique
171-
TypebotSession TypebotSession[]
172-
}
173-
174158
enum TypebotSessionStatus {
175159
open
176160
closed
177161
paused
178162
}
179163

180-
model TypebotSession {
181-
id Int @id @default(autoincrement())
182-
sessionId String @db.VarChar(200)
183-
remoteJid String @db.VarChar(100)
184-
status TypebotSessionStatus @default(open)
185-
Typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade)
186-
typebotId Int
187-
Message Message[]
188-
}
189-
190164
enum StartConversationAs {
191165
open
192166
pending

src/whatsapp/services/whatsapp.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ export class WAStartupService {
14531453

14541454
let ext = mediaMessage.extension;
14551455

1456-
if (isURL(mediaMessage.media as string)) {
1456+
if (['http', 'https'].includes(mediaMessage.media as string)) {
14571457
const response = await axios.get(mediaMessage.media as string, {
14581458
responseType: 'arraybuffer',
14591459
});

0 commit comments

Comments
 (0)