From aba239188f79d6d3a1606effdf7fcab916de4d40 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 29 Jan 2023 19:04:21 +0100 Subject: [PATCH] Black list path format includes @ but not Mastodon --- src/utils/helpers/urlMatcher.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils/helpers/urlMatcher.ts b/src/utils/helpers/urlMatcher.ts index a6e90d60..9f70780a 100644 --- a/src/utils/helpers/urlMatcher.ts +++ b/src/utils/helpers/urlMatcher.ts @@ -1,6 +1,9 @@ import { getAccountStorage } from '@utils/storage/actions' import parse from 'url-parse' +// Would mess with the /@username format +const BLACK_LIST = ['matters.news', 'medium.com'] + export const urlMatcher = ( url: string ): @@ -14,6 +17,10 @@ export const urlMatcher = ( if (!parsed.hostname.length || !parsed.pathname.length) return undefined const domain = parsed.hostname + if (BLACK_LIST.includes(domain)) { + return + } + const _remote = parsed.hostname !== getAccountStorage.string('auth.domain') let statusId: string | undefined