diff --git a/src/util/ensureProtocol.ts b/src/util/ensureProtocol.ts index 40f07af36..f46945967 100644 --- a/src/util/ensureProtocol.ts +++ b/src/util/ensureProtocol.ts @@ -1,7 +1,5 @@ const PROTOCOL_WHITELIST = new Set(['http:', 'https:', 'tg:', 'ton:', 'mailto:', 'tel:']); -// HTTP was chosen by default as a fix for https://bugs.telegram.org/c/10712. -// It is also the default protocol in the official TDesktop client. -const FALLBACK_PREFIX = 'http://'; +const FALLBACK_PREFIX = 'https://'; export function ensureProtocol(url?: string) { if (!url) { diff --git a/src/util/parseMessageInput.ts b/src/util/parseMessageInput.ts index 90fe7058e..f23eada5b 100644 --- a/src/util/parseMessageInput.ts +++ b/src/util/parseMessageInput.ts @@ -135,7 +135,7 @@ function parseMarkdown(html: string) { function parseMarkdownLinks(html: string) { return html.replace(new RegExp(`\\[([^\\]]+?)]\\((${RE_LINK_TEMPLATE}+?)\\)`, 'g'), (_, text, link) => { - const url = link.includes('://') ? link : link.includes('@') ? `mailto:${link}` : `http://${link}`; + const url = link.includes('://') ? link : link.includes('@') ? `mailto:${link}` : `https://${link}`; return `${text}`; }); }