[backend/masto-client] Ignore App.website property when it only contains whitespace
This commit is contained in:
parent
a703b63876
commit
c7bacc2856
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue