Fix avatar URLs with encoded spaces

This commit is contained in:
Ske 2020-09-12 19:43:54 +02:00
parent 7b59040da2
commit 5ba89d32fc

View File

@ -39,7 +39,9 @@ namespace PluralKit.Bot
if (uri.Scheme != "http" && uri.Scheme != "https")
throw Errors.InvalidUrl(arg);
return new ParsedImage {Url = TryRewriteCdnUrl(uri.ToString()), Source = AvatarSource.Url};
// ToString URL-decodes, which breaks URLs to spaces; AbsoluteUri doesn't
return new ParsedImage {Url = TryRewriteCdnUrl(uri.AbsoluteUri), Source = AvatarSource.Url};
}
// If we have an attachment, use that