Don't try generating link previews for debuglogs.org

This commit is contained in:
Evan Hahn
2022-03-08 14:04:44 -06:00
committed by GitHub
parent 4e48d7792b
commit efee887135
4 changed files with 30 additions and 21 deletions

View File

@@ -28,9 +28,14 @@ export type LinkPreviewWithDomain = {
const linkify = LinkifyIt();
export function isLinkSafeToPreview(href: string): boolean {
export function shouldPreviewHref(href: string): boolean {
const url = maybeParseUrl(href);
return Boolean(url && url.protocol === 'https:' && !isLinkSneaky(href));
return Boolean(
url &&
url.protocol === 'https:' &&
url.hostname !== 'debuglogs.org' &&
!isLinkSneaky(href)
);
}
export function isStickerPack(link = ''): boolean {