diff --git a/src/app/utils/videoEmbed.ts b/src/app/utils/videoEmbed.ts index 1999ab64a..9bf1bcf8c 100644 --- a/src/app/utils/videoEmbed.ts +++ b/src/app/utils/videoEmbed.ts @@ -363,9 +363,11 @@ const SOUNDCLOUD_PROFILE_TABS = new Set([ export function isSoundCloudTrack(url: string): boolean { try { const { hostname, pathname } = new URL(url); - // NOTE: on.soundcloud.com short links are NOT handled here — the w.soundcloud - // widget resolver doesn't follow the redirect; supporting them needs an oEmbed - // round-trip (soundcloud.com/oembed is CORS-enabled) to get the canonical URL. + // on.soundcloud.com short links are not matched here (the w.soundcloud widget + // doesn't follow the redirect), but they still embed: Synapse follows the + // redirect when building the preview, and UrlPreviewCard's og:url fallback + // re-parses the canonical soundcloud.com// URL (verified with + // a real short link, Gitea #200). if (hostname.replace(/^www\./, '') !== 'soundcloud.com') return false; // // — at least two segments, not a bare profile const parts = pathname