From f03bab303cc7efe8f26f7d9edf1f356750448982 Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 5 Jul 2020 13:19:43 +0200 Subject: [PATCH] Explicitly error if the URI schema is wrong --- PluralKit.Bot/Utils/AvatarUtils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Utils/AvatarUtils.cs b/PluralKit.Bot/Utils/AvatarUtils.cs index 12569c02..837fc2fc 100644 --- a/PluralKit.Bot/Utils/AvatarUtils.cs +++ b/PluralKit.Bot/Utils/AvatarUtils.cs @@ -26,7 +26,8 @@ namespace PluralKit.Bot { try { uri = new Uri(url); - if (!uri.IsAbsoluteUri) throw Errors.InvalidUrl(url); + if (!uri.IsAbsoluteUri || (uri.Scheme != "http" && uri.Scheme != "https")) + throw Errors.InvalidUrl(url); } catch (UriFormatException) {