mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-06-02 13:29:36 +00:00
Add date header when sending activity
This commit is contained in:
parent
356b98bb97
commit
7e4b9772d6
|
@ -16,6 +16,7 @@ use background_jobs::{
|
|||
MaxRetries,
|
||||
WorkerConfig,
|
||||
};
|
||||
use chrono::Utc;
|
||||
use http::{header::HeaderName, HeaderMap, HeaderValue};
|
||||
use itertools::Itertools;
|
||||
use reqwest_middleware::ClientWithMiddleware;
|
||||
|
@ -187,6 +188,10 @@ fn generate_request_headers(inbox_url: &Url) -> HeaderMap {
|
|||
HeaderName::from_static("host"),
|
||||
HeaderValue::from_str(&host).expect("Hostname is valid"),
|
||||
);
|
||||
headers.insert(
|
||||
"date",
|
||||
HeaderValue::from_str(&Utc::now().to_rfc2822()).expect("Hostname is valid"),
|
||||
);
|
||||
headers
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue