From 89938a7c53a3ab03c3bb0006052e106c2e699bf1 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 25 Jun 2023 02:51:20 +0200 Subject: [PATCH] relay: contrive a custom id of announcements Relates to Github issue #4: ActivityPub implementations may check that the host in this URI is the HTTP-signing host. https://github.com/misskey-dev/misskey/blob/e2261b63e9053fb5116dd0ef393f464bf16da190/packages/backend/src/queue/processors/InboxProcessorService.ts#L159 --- src/relay.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/relay.rs b/src/relay.rs index 1137f4e..0f5be50 100644 --- a/src/relay.rs +++ b/src/relay.rs @@ -180,13 +180,14 @@ pub fn spawn( } let actor_id = Arc::new(actor.uri()); + let announce_id = format!("https://{}/announce/{}", hostname, urlencoding::encode(&post_url)); let body = json!({ "@context": "https://www.w3.org/ns/activitystreams", "type": "Announce", "actor": *actor_id, "to": ["https://www.w3.org/ns/activitystreams#Public"], "object": &post.uri, - "id": *post_url, + "id": announce_id, }); let Ok(post_url_url) = reqwest::Url::parse(&post_url) else { continue; }; let body = Arc::new(