From fb678bc20850dd2ec7641fa1a85963f5e9d3f8c9 Mon Sep 17 00:00:00 2001 From: Bagas Wastu Date: Mon, 4 Dec 2023 13:00:49 +0700 Subject: [PATCH] fix: make the replaced url more robust for twitter Co-authored-by: Ronny Gunawan <3048897+ronnygunawan@users.noreply.github.com> --- BotNet.Services/SocialLink/SocialLinkEmbedFixer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BotNet.Services/SocialLink/SocialLinkEmbedFixer.cs b/BotNet.Services/SocialLink/SocialLinkEmbedFixer.cs index 29e7a40..56d03a7 100644 --- a/BotNet.Services/SocialLink/SocialLinkEmbedFixer.cs +++ b/BotNet.Services/SocialLink/SocialLinkEmbedFixer.cs @@ -7,7 +7,7 @@ public partial class SocialLinkEmbedFixer { public static Uri Fix(Uri link) { string url = link.ToString(); string newUrl = link.Host switch { - "twitter.com" => url.Replace("twitter.com", "vxtwitter.com"), + "twitter.com" => url.Replace("//twitter.com/", "//vxtwitter.com/"), "www.twitter.com" => url.Replace("twitter.com", "vxtwitter.com"), "x.com" => url.Replace("x.com", "vxtwitter.com"), "www.x.com" => url.Replace("x.com", "vxtwitter.com"),