1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-24 08:57:03 -05:00

Split check for schema and host

This commit is contained in:
erik 2023-11-22 15:27:44 +01:00 committed by Michael Jerger
parent 3d2b5115ad
commit 7b5d13a625

View file

@ -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") {