mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user