Split check for schema and host
This commit is contained in:
parent
3d2b5115ad
commit
7b5d13a625
1 changed files with 6 additions and 2 deletions
|
@ -21,8 +21,12 @@ type ActorID struct {
|
||||||
// TODO: Align validation-api to example from dda-devops-build
|
// TODO: Align validation-api to example from dda-devops-build
|
||||||
func (a ActorID) Validate() error {
|
func (a ActorID) Validate() error {
|
||||||
|
|
||||||
if a.schema == "" || a.host == "" {
|
if a.schema == "" {
|
||||||
return fmt.Errorf("the actor ID was not valid: Invalid Schema or Host")
|
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") {
|
if !strings.Contains(a.path, "api/v1/activitypub/user-id") {
|
||||||
|
|
Loading…
Add table
Reference in a new issue