cave/activitypub: use the right MIME_TYPE

This commit is contained in:
Astro 2023-10-17 16:41:45 +02:00
parent 2f66958a6a
commit c3c67a54e4
3 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -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")]

View File

@ -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())