Send the 'Content-Type: application/activity+json' header for ActivityPub request

Should fix #76
This commit is contained in:
Bat 2018-06-23 12:23:37 +01:00
parent 6140865660
commit 236767f498

View File

@ -1,7 +1,13 @@
use base64;
use openssl::hash::{Hasher, MessageDigest};
use reqwest::header::{Date, Headers, UserAgent};
use std::time::SystemTime;
use reqwest::{
mime::Mime,
header::{ContentType, Date, Headers, UserAgent}
};
use std::{
str::FromStr,
time::SystemTime
};
use activity_pub::sign::Signer;
@ -19,6 +25,7 @@ pub fn headers() -> Headers {
let mut headers = Headers::new();
headers.set(UserAgent::new(USER_AGENT));
headers.set(Date(SystemTime::now().into()));
headers.set(ContentType(Mime::from_str("application/activity+json").unwrap()));
headers
}