mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2025-01-20 01:55:25 +00:00
Send the 'Content-Type: application/activity+json' header for ActivityPub request
Should fix #76
This commit is contained in:
parent
6140865660
commit
236767f498
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue