1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

Allow parsing of repository-id too

This commit is contained in:
erik 2023-12-06 15:16:01 +01:00 committed by Michael Jerger
parent 4f25e5057a
commit c0f1681fa3

View file

@ -53,8 +53,9 @@ func (a ActorID) Validate() []string {
switch a.source {
case "forgejo", "gitea":
if !strings.Contains(a.path, "api/v1/activitypub/user-id") {
err = append(err, fmt.Errorf("the Path to the API was invalid: %v", a.path).Error())
if !strings.Contains(a.path, "api/v1/activitypub/user-id") &&
!strings.Contains(a.path, "api/v1/activitypub/repository-id") {
err = append(err, fmt.Errorf("the Path to the API was invalid: ---%v---", a.path).Error())
}
default:
err = append(err, fmt.Errorf("currently only forgeo and gitea sources are allowed from actor id").Error())