mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 03:38:52 +03:00
Use ValidateAndParseIRI, pass this to ParseActorID
This commit is contained in:
parent
fa1acd1ebb
commit
f84e0b27e1
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue