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.
e2261b63e9/packages/backend/src/queue/processors/InboxProcessorService.ts (L159)
This commit is contained in:
Astro 2023-06-25 02:51:20 +02:00
parent 363152b0b4
commit 89938a7c53

View file

@ -180,13 +180,14 @@ pub fn spawn(
} }
let actor_id = Arc::new(actor.uri()); let actor_id = Arc::new(actor.uri());
let announce_id = format!("https://{}/announce/{}", hostname, urlencoding::encode(&post_url));
let body = json!({ let body = json!({
"@context": "https://www.w3.org/ns/activitystreams", "@context": "https://www.w3.org/ns/activitystreams",
"type": "Announce", "type": "Announce",
"actor": *actor_id, "actor": *actor_id,
"to": ["https://www.w3.org/ns/activitystreams#Public"], "to": ["https://www.w3.org/ns/activitystreams#Public"],
"object": &post.uri, "object": &post.uri,
"id": *post_url, "id": announce_id,
}); });
let Ok(post_url_url) = reqwest::Url::parse(&post_url) else { continue; }; let Ok(post_url_url) = reqwest::Url::parse(&post_url) else { continue; };
let body = Arc::new( let body = Arc::new(