diff --git a/models/forgefed/federationinfo.go b/models/forgefed/federationinfo.go index 80380641b9..e14e2feb4c 100644 --- a/models/forgefed/federationinfo.go +++ b/models/forgefed/federationinfo.go @@ -36,8 +36,8 @@ func NewFederationInfo(nodeInfo NodeInfo, hostFqdn string) (FederationInfo, erro // Validate collects error strings in a slice and returns this func (info FederationInfo) Validate() []string { var result []string - result = append(result, validation.ValidateNotEmpty(string(info.HostFqdn), "HostFqdn")...) - result = append(result, validation.ValidateMaxLen(string(info.HostFqdn), 255, "HostFqdn")...) + result = append(result, validation.ValidateNotEmpty(info.HostFqdn, "HostFqdn")...) + result = append(result, validation.ValidateMaxLen(info.HostFqdn, 255, "HostFqdn")...) result = append(result, info.NodeInfo.Validate()...) return result diff --git a/models/forgefed/nodeinfo.go b/models/forgefed/nodeinfo.go index 23ce7642f8..3e64f02c34 100644 --- a/models/forgefed/nodeinfo.go +++ b/models/forgefed/nodeinfo.go @@ -81,7 +81,7 @@ func (node NodeInfoWellKnown) Validate() []string { return result } -func (id ActorID) AsWellKnownNodeInfoUri() string { +func (id ActorID) AsWellKnownNodeInfoURI() string { wellKnownPath := ".well-known/nodeinfo" var result string if id.Port == "" { diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index bcc498a83d..ee5b398a8f 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -89,8 +89,8 @@ func RepositoryInbox(ctx *context.APIContext) { log.Info("RepositoryInbox: activity validated:%v", activity) // parse actorID (person) - actorUri := activity.Actor.GetID().String() - rawActorID, err := forgefed.NewActorID(actorUri) + actorURI := activity.Actor.GetID().String() + rawActorID, err := forgefed.NewActorID(actorURI) federationInfo, err := forgefed.FindFederationInfoByHostFqdn(ctx, rawActorID.Host) if err != nil { ctx.Error(http.StatusInternalServerError, @@ -112,7 +112,7 @@ func RepositoryInbox(ctx *context.APIContext) { return } - actorID, err := forgefed.NewPersonID(actorUri, string(federationInfo.NodeInfo.Source)) + actorID, err := forgefed.NewPersonID(actorURI, string(federationInfo.NodeInfo.Source)) if err != nil { ctx.Error(http.StatusNotAcceptable, "RepositoryInbox: Validate actorId", err) return @@ -212,7 +212,7 @@ func createFederationInfo(ctx *context.APIContext, actorID forgefed.ActorID) (fo if err != nil { return forgefed.FederationInfo{}, err } - body, err := client.GetBody(actorID.AsWellKnownNodeInfoUri()) + body, err := client.GetBody(actorID.AsWellKnownNodeInfoURI()) if err != nil { return forgefed.FederationInfo{}, err }