diff --git a/cave/src/activitypub/fetch.rs b/cave/src/activitypub/fetch.rs index b1fb039..049bf3f 100644 --- a/cave/src/activitypub/fetch.rs +++ b/cave/src/activitypub/fetch.rs @@ -21,9 +21,9 @@ where let mut req = http::Request::builder() .uri(uri) .header("host", &host) - .header("content-type", "application/activity+json") + .header("content-type", super::MIME_TYPE) + .header("accept", super::MIME_TYPE) .header("date", httpdate::fmt_http_date(SystemTime::now())) - .header("accept", "application/activity+json, application/ld+json") .header("digest", digest_header) .body(vec![])?; SigningConfig::new(RsaSha256, private_key, key_id) diff --git a/cave/src/activitypub/mod.rs b/cave/src/activitypub/mod.rs index 5bf5090..a95d7ec 100644 --- a/cave/src/activitypub/mod.rs +++ b/cave/src/activitypub/mod.rs @@ -7,6 +7,8 @@ pub use error::Error; use std::collections::HashMap; use serde::{Deserialize, Serialize}; +const MIME_TYPE: &str = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""; + #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Actor { #[serde(rename = "@context")] diff --git a/cave/src/activitypub/send.rs b/cave/src/activitypub/send.rs index 5344af1..dce0f0c 100644 --- a/cave/src/activitypub/send.rs +++ b/cave/src/activitypub/send.rs @@ -37,7 +37,8 @@ pub async fn send_raw( .method("POST") .uri(uri) .header("host", &host) - .header("content-type", "application/activity+json") + .header("content-type", super::MIME_TYPE) + .header("accept", super::MIME_TYPE) .header("date", httpdate::fmt_http_date(SystemTime::now())) .header("digest", digest_header) .body(body.as_ref().clone())