Accept webfinger requests where "resource" is instance actor ID

This commit is contained in:
silverpill 2023-02-19 21:47:12 +00:00
parent 21054de712
commit 2f621201f8
2 changed files with 6 additions and 4 deletions

View file

@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Support `authorization_code` OAuth grant type. - Support `authorization_code` OAuth grant type.
- Documented `http_cors_allowlist` configuration parameter. - Documented `http_cors_allowlist` configuration parameter.
- Added `/api/v1/statuses/{status_id}/thread` API endpoint (replaces `/api/v1/statuses/{status_id}/context`). - Added `/api/v1/statuses/{status_id}/thread` API endpoint (replaces `/api/v1/statuses/{status_id}/context`).
- Accept webfinger requests where `resource` is instance actor ID.
### Changed ### Changed

View file

@ -38,10 +38,11 @@ async fn get_jrd(
parse_acct_uri(resource)? parse_acct_uri(resource)?
} else { } else {
// Actor ID? (reverse webfinger) // Actor ID? (reverse webfinger)
let username = parse_local_actor_id( let username = if resource == local_instance_actor_id(&instance.url()) {
&instance.url(), instance.hostname()
resource, } else {
)?; parse_local_actor_id(&instance.url(), resource)?
};
ActorAddress { username, hostname: instance.hostname() } ActorAddress { username, hostname: instance.hostname() }
}; };
if actor_address.hostname != instance.hostname() { if actor_address.hostname != instance.hostname() {