diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-03-02 13:04:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-02 13:04:51 +0900 |
commit | ab2b454be8f15ccd4176edce2d28abdce501274b (patch) | |
tree | 41e198f85a4372950ce39a6613d231b2d5932be1 /src/lib/strings/url-helpers.ts | |
parent | 537ae578d6501319e07132ea8b12c280e0755fca (diff) | |
parent | b70c404d4b369d6fab0dfbafd6b31390ffd20014 (diff) | |
download | voidsky-ab2b454be8f15ccd4176edce2d28abdce501274b.tar.zst |
Merge branch 'bluesky-social:main' into patch-3
Diffstat (limited to 'src/lib/strings/url-helpers.ts')
-rw-r--r-- | src/lib/strings/url-helpers.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index ef341154d..ba2cdb39b 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -157,17 +157,11 @@ export function linkRequiresWarning(uri: string, label: string) { const host = urip.hostname.toLowerCase() - if (host === 'bsky.app') { + // Hosts that end with bsky.app or bsky.social should be trusted by default. + if (host.endsWith('bsky.app') || host.endsWith('bsky.social')) { // if this is a link to internal content, // warn if it represents itself as a URL to another app - if ( - labelDomain && - labelDomain !== 'bsky.app' && - isPossiblyAUrl(labelDomain) - ) { - return true - } - return false + return !!labelDomain && labelDomain !== host && isPossiblyAUrl(labelDomain) } else { // if this is a link to external content, // warn if the label doesnt match the target |