mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-23 23:34:26 +01:00
Pretend to be WhatsApp when fetching links
This commit is contained in:
@@ -13,7 +13,11 @@ async function unfurlCard(url: string, signal: AbortSignal): Promise<PreviewCard
|
||||
debug(`Unfurling ${url}...`);
|
||||
try {
|
||||
const result = await unfurl(url, {
|
||||
fetch: (url) => fetchWorker(url, { signal }),
|
||||
fetch: (url) =>
|
||||
fetchWorker(url, {
|
||||
headers: { 'User-Agent': 'WhatsApp/2' },
|
||||
signal,
|
||||
}),
|
||||
});
|
||||
|
||||
const { oEmbed, title, description, canonical_url, open_graph } = result;
|
||||
|
||||
Reference in New Issue
Block a user