mirror of https://github.com/go-gitea/gitea.git
Make sure Person IRIs are generated correctly
This commit ensures that if the setting.AppURL is something like "http://127.0.0.1:42567" (like in the integration tests), a trailing slash will be added after that URL.
This commit is contained in:
parent
d06772b376
commit
a3120079a5
|
@ -6,6 +6,7 @@ package activitypub
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/activitypub"
|
"code.gitea.io/gitea/modules/activitypub"
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
|
@ -33,7 +34,7 @@ func Person(ctx *context.APIContext) {
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/ActivityPub"
|
// "$ref": "#/responses/ActivityPub"
|
||||||
|
|
||||||
link := setting.AppURL + "api/v1/activitypub/user/" + ctx.ContextUser.Name
|
link := strings.TrimSuffix(setting.AppURL, "/") + "/api/v1/activitypub/user/" + ctx.ContextUser.Name
|
||||||
person := ap.PersonNew(ap.IRI(link))
|
person := ap.PersonNew(ap.IRI(link))
|
||||||
|
|
||||||
person.Name = ap.NaturalLanguageValuesNew()
|
person.Name = ap.NaturalLanguageValuesNew()
|
||||||
|
|
Loading…
Reference in New Issue