Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 01:44:24 +01:00

Use ValidateAndParseIRI, pass this to ParseActorID

This commit is contained in:
erik 2023-12-07 11:45:24 +01:00 committed by Michael Jerger
parent fa1acd1ebb
commit f84e0b27e1

View file

@ -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()