From 5499a20a2cc7f1ea0ad7629b055762e62e55c593 Mon Sep 17 00:00:00 2001 From: Iris System Date: Wed, 14 Feb 2024 04:19:11 +1300 Subject: [PATCH] fix(bot): allow mixed-case file extensions for CDN URLs --- PluralKit.Bot/Utils/AvatarUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Utils/AvatarUtils.cs b/PluralKit.Bot/Utils/AvatarUtils.cs index 70206593..0f6d314c 100644 --- a/PluralKit.Bot/Utils/AvatarUtils.cs +++ b/PluralKit.Bot/Utils/AvatarUtils.cs @@ -63,7 +63,7 @@ public static class AvatarUtils // This lets us add resizing parameters to "borrow" their media proxy server to downsize the image // which in turn makes it more likely to be underneath the size limit! private static readonly Regex DiscordCdnUrl = - new(@"^https?://(?:cdn\.discordapp\.com|media\.discordapp\.net)/attachments/(\d{17,19})/(\d{17,19})/([^/\\&\?]+)\.(png|jpg|jpeg|webp)(?:\?(?.*))?$"); + new(@"^https?://(?:cdn\.discordapp\.com|media\.discordapp\.net)/attachments/(\d{17,19})/(\d{17,19})/([^/\\&\?]+)\.(png|jpe?g|webp)(?:\?(?.*))?$", RegexOptions.IgnoreCase); private static readonly string DiscordMediaUrlReplacement = "https://media.discordapp.net/attachments/$1/$2/$3.$4?width=256&height=256";