diff --git a/packages/backend/src/services/fetch-instance-metadata.ts b/packages/backend/src/services/fetch-instance-metadata.ts index ad312c3c8..71eb3269a 100644 --- a/packages/backend/src/services/fetch-instance-metadata.ts +++ b/packages/backend/src/services/fetch-instance-metadata.ts @@ -246,19 +246,20 @@ async function getSiteName(info: NodeInfo | null, doc: DOMWindow['document'] | n async function getDescription(info: NodeInfo | null, doc: DOMWindow['document'] | null, manifest: Record | null): Promise { if (info && info.metadata) { - if (info.metadata.nodeDescription || info.metadata.description) { - return info.metadata.nodeDescription || info.metadata.description; + const description = info.metadata.nodeDescription || info.metadata.description; + if (description && description.length < 4096) { + return description; } } if (doc) { const meta = doc.querySelector('meta[name="description"]')?.getAttribute('content'); - if (meta) { + if (meta && meta.length < 4096) { return meta; } const og = doc.querySelector('meta[property="og:description"]')?.getAttribute('content'); - if (og) { + if (og && og.length < 4096) { return og; } }