From f84e0b27e1a71a4fc0606d81ca163a69935d4f98 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 7 Dec 2023 11:45:24 +0100 Subject: [PATCH] Use ValidateAndParseIRI, pass this to ParseActorID --- routers/api/v1/activitypub/repository.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index 7c86302ba9..d48ac15bbf 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -245,7 +245,11 @@ func RepositoryInbox(ctx *context.APIContext) { // parse senderActorId // senderActorId holds the data to construct the sender of the star log.Info("activity.Actor.GetID().String(): %v", activity.Actor.GetID().String()) - senderActorId, err := activitypub.ParseActorID(activity.Actor.GetID().String(), string(activity.Source)) + validatedURL, err := activitypub.ValidateAndParseIRI(activity.Actor.GetID().String()) + if err != nil { + panic(err) + } + senderActorId := activitypub.ParseActorID(validatedURL, string(activity.Source)) // Is the ActorID Struct valid? senderActorId.PanicIfInvalid()