mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 22:37:54 +00:00
DRY-ify checking URL length for avatars
This commit is contained in:
parent
7f82a3e63a
commit
05f1ee92ea
4 changed files with 4 additions and 12 deletions
|
|
@ -11,6 +11,9 @@ namespace PluralKit.Bot {
|
|||
public static class AvatarUtils {
|
||||
public static async Task VerifyAvatarOrThrow(string url)
|
||||
{
|
||||
if (url.Length > Limits.MaxUriLength)
|
||||
throw Errors.UrlTooLong(url);
|
||||
|
||||
// List of MIME types we consider acceptable
|
||||
var acceptableMimeTypes = new[]
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue