Skip to content

Commit

Permalink
fix: make the replaced url more robust for twitter
Browse files Browse the repository at this point in the history
Co-authored-by: Ronny Gunawan <[email protected]>
  • Loading branch information
bgwastu and ronnygunawan authored Dec 4, 2023
1 parent c4b6df7 commit fb678bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BotNet.Services/SocialLink/SocialLinkEmbedFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit fb678bc

Please sign in to comment.