mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-22 01:44:24 +01:00
lint fix
This commit is contained in:
parent
9a9ac33766
commit
c4eb763f4a
|
@ -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
|
||||
|
|
|
@ -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 == "" {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue