diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-04 10:08:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 10:08:23 +0800 |
commit | 17f23182ffdada3dee6a01ab2b49547e680bb02c (patch) | |
tree | fd0a62a042183da3dca5911440db68ab2f12b1bb /tests/integration/webfinger_test.go | |
parent | 5115ffa90c959086704b6e3437214a192de7b8a7 (diff) | |
download | gitea-17f23182ffdada3dee6a01ab2b49547e680bb02c.tar.gz gitea-17f23182ffdada3dee6a01ab2b49547e680bb02c.zip |
Use User.ID instead of User.Name in ActivityPub API for Person IRI (#23823)
Thanks to @trwnh
Close #23802
The ActivityPub id is an HTTPS URI that should remain constant, even if
the user changes their name.
Diffstat (limited to 'tests/integration/webfinger_test.go')
-rw-r--r-- | tests/integration/webfinger_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/integration/webfinger_test.go b/tests/integration/webfinger_test.go index 226c25615f..f67abdbc2a 100644 --- a/tests/integration/webfinger_test.go +++ b/tests/integration/webfinger_test.go @@ -52,7 +52,7 @@ func TestWebfinger(t *testing.T) { var jrd webfingerJRD DecodeJSON(t, resp, &jrd) assert.Equal(t, "acct:user2@"+appURL.Host, jrd.Subject) - assert.ElementsMatch(t, []string{user.HTMLURL(), appURL.String() + "api/v1/activitypub/user/" + url.PathEscape(user.Name)}, jrd.Aliases) + assert.ElementsMatch(t, []string{user.HTMLURL(), appURL.String() + "api/v1/activitypub/user-id/" + fmt.Sprint(user.ID)}, jrd.Aliases) req = NewRequest(t, "GET", fmt.Sprintf("/.well-known/webfinger?resource=acct:%s@%s", user.LowerName, "unknown.host")) MakeRequest(t, req, http.StatusBadRequest) |