From c7bacc2856d098849dcc3fe654b8bfb115f67974 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 14 Jun 2024 21:45:29 +0200 Subject: [PATCH] [backend/masto-client] Ignore App.website property when it only contains whitespace --- Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs b/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs index bbd04bed..f5631b34 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs @@ -53,10 +53,10 @@ public class AuthController(DatabaseContext db, MetaService meta) : ControllerBa if (!MastodonOauthHelpers.ValidateScopes(request.Scopes)) throw GracefulException.BadRequest("Invalid scopes parameter"); - if (request.Website != null) + if (!string.IsNullOrWhiteSpace(request.Website)) try { - var uri = new Uri(request.Website); + var uri = new Uri(request.Website.Trim()); if (!uri.IsAbsoluteUri || uri.Scheme is not "http" and not "https") throw new Exception(); } catch