From 4e6020b88cdba8334ee97ea14f8fc7d782f1998a Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 6 Mar 2024 11:34:48 -0800 Subject: [PATCH] fix internal links showing up as external (#3128) * fix internal links showing up as external * fix internal links showing up as external --- src/lib/strings/url-helpers.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index ba2cdb39..ee88225e 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -158,7 +158,12 @@ export function linkRequiresWarning(uri: string, label: string) { const host = urip.hostname.toLowerCase() // Hosts that end with bsky.app or bsky.social should be trusted by default. - if (host.endsWith('bsky.app') || host.endsWith('bsky.social')) { + if ( + uri.startsWith('/') || + host.endsWith('bsky.app') || + host.endsWith('bsky.social') || + host.endsWith('blueskyweb.xyz') + ) { // if this is a link to internal content, // warn if it represents itself as a URL to another app return !!labelDomain && labelDomain !== host && isPossiblyAUrl(labelDomain)