From 7b5d13a625779c3db035ca80d0da706b46357568 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 22 Nov 2023 15:27:44 +0100 Subject: [PATCH] Split check for schema and host --- models/activitypub/actor.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/models/activitypub/actor.go b/models/activitypub/actor.go index 94acacdfdd..e0712fa1d7 100644 --- a/models/activitypub/actor.go +++ b/models/activitypub/actor.go @@ -21,8 +21,12 @@ type ActorID struct { // TODO: Align validation-api to example from dda-devops-build func (a ActorID) Validate() error { - if a.schema == "" || a.host == "" { - return fmt.Errorf("the actor ID was not valid: Invalid Schema or Host") + if a.schema == "" { + return fmt.Errorf("the actor ID was not valid: Invalid Schema") + } + + if a.host == "" { + return fmt.Errorf("the actor ID was not valid: Invalid Host") } if !strings.Contains(a.path, "api/v1/activitypub/user-id") {