diff options
author | Mary <148872143+mary-ext@users.noreply.github.com> | 2024-01-19 12:13:28 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 21:13:28 -0800 |
commit | 2be27330822e294989513719919ca2cd9ac30adb (patch) | |
tree | 9c8febc1eaa96dd3f934a8f68e3926a16323b0f5 | |
parent | ddca849e0d6bd98c2370613d17d2a579691c5282 (diff) | |
download | voidsky-2be27330822e294989513719919ca2cd9ac30adb.tar.zst |
fix: exempt well-known paths from being handled (#2505)
-rw-r--r-- | src/view/com/util/Link.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/view/com/util/Link.tsx b/src/view/com/util/Link.tsx index 4f898767d..db26258d6 100644 --- a/src/view/com/util/Link.tsx +++ b/src/view/com/util/Link.tsx @@ -306,6 +306,8 @@ export const TextLinkOnWebOnly = memo(function DesktopWebTextLink({ ) }) +const EXEMPT_PATHS = ['/robots.txt', '/security.txt', '/.well-known/'] + // NOTE // we can't use the onPress given by useLinkProps because it will // match most paths to the HomeTab routes while we actually want to @@ -350,7 +352,12 @@ function onPressInner( if (shouldHandle) { href = convertBskyAppUrlIfNeeded(href) - if (newTab || href.startsWith('http') || href.startsWith('mailto')) { + if ( + newTab || + href.startsWith('http') || + href.startsWith('mailto') || + EXEMPT_PATHS.some(path => href.startsWith(path)) + ) { openLink(href) } else { closeModal() // close any active modals |