mirror of
1
Fork 0

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
1 changed files with 5 additions and 1 deletions

View File

@ -245,7 +245,11 @@ func RepositoryInbox(ctx *context.APIContext) {
// parse senderActorId // parse senderActorId
// senderActorId holds the data to construct the sender of the star // senderActorId holds the data to construct the sender of the star
log.Info("activity.Actor.GetID().String(): %v", activity.Actor.GetID().String()) 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? // Is the ActorID Struct valid?
senderActorId.PanicIfInvalid() senderActorId.PanicIfInvalid()