Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(baileys): send text statuses with an explicit no-preview

Yudhi Armyndharis937828a5bc4c
diff --git a/src/engine/adapters/baileys-status.ts b/src/engine/adapters/baileys-status.ts
index 4516a11d7..b8c1f2853 100644
--- a/src/engine/adapters/baileys-status.ts
+++ b/src/engine/adapters/baileys-status.ts
@@ -38,7 +38,9 @@ export class BaileysStatus {
}
postTextStatus(text: string, options: StatusPostOptions): Promise<StatusResult> {
- return this.postStatus({ text }, options);
+ // `linkPreview: null` is Baileys' explicit "no preview": with the key absent it runs its own
+ // generator (link-preview-js, unfixed SSRF advisory) on any URL in the status text.
+ return this.postStatus({ text, linkPreview: null }, options);
}
postImageStatus(media: MediaInput, options: StatusPostOptions): Promise<StatusResult> {
diff --git a/src/engine/adapters/baileys.adapter.spec.ts b/src/engine/adapters/baileys.adapter.spec.ts
index 735607a6e..9973227f0 100644
--- a/src/engine/adapters/baileys.adapter.spec.ts
+++ b/src/engine/adapters/baileys.adapter.spec.ts
@@ -6345,7 +6345,7 @@ describe('BaileysAdapter status posting', () => {
});
expect(fakeSock.sendMessage).toHaveBeenCalledWith(
'status@broadcast',
- { text: 'hello' },
+ { text: 'hello', linkPreview: null },
{
statusJidList: ['[email protected]', '628222@lid'],
backgroundColor: '#25D366',