1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 10:33:22 +08:00

Remove unnecessary usage of link proxying in OsuOnlineStore

Links are checked to be in the ppy.sh domain here.
This commit is contained in:
Salman Alshamrani 2024-11-30 22:37:05 -05:00
parent dbe2741982
commit 9a4c419c56

View File

@ -18,13 +18,14 @@ namespace osu.Game.Online
protected override string GetLookupUrl(string url)
{
// add leading dot to avoid matching hosts named "<anything>ppy.sh"
if (!Uri.TryCreate(url, UriKind.Absolute, out Uri? uri) || !uri.Host.EndsWith(@".ppy.sh", StringComparison.OrdinalIgnoreCase))
{
Logger.Log($@"Blocking resource lookup from external website: {url}", LoggingTarget.Network, LogLevel.Important);
return string.Empty;
}
return $@"{apiEndpointUrl}/beatmapsets/discussions/media-url?url={url}";
return url;
}
}
}