mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Merge pull request #1915 from LemmyNet/remove-http-sig-compat
Remove HTTP signature compatibility mode (its not necessary)
This commit is contained in:
commit
1f03a2d957
@ -1,5 +1,4 @@
|
|||||||
use crate::APUB_JSON_CONTENT_TYPE;
|
use crate::APUB_JSON_CONTENT_TYPE;
|
||||||
use activitystreams::chrono::Utc;
|
|
||||||
use actix_web::HttpRequest;
|
use actix_web::HttpRequest;
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use http::{header::HeaderName, HeaderMap, HeaderValue};
|
use http::{header::HeaderName, HeaderMap, HeaderValue};
|
||||||
@ -20,7 +19,7 @@ use url::Url;
|
|||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref CONFIG2: ConfigActix = ConfigActix::new();
|
static ref CONFIG2: ConfigActix = ConfigActix::new();
|
||||||
static ref HTTP_SIG_CONFIG: Config = Config::new().mastodon_compat();
|
static ref HTTP_SIG_CONFIG: Config = Config::new();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates an HTTP post request to `inbox_url`, with the given `client` and `headers`, and
|
/// Creates an HTTP post request to `inbox_url`, with the given `client` and `headers`, and
|
||||||
@ -44,9 +43,6 @@ pub async fn sign_and_send(
|
|||||||
HeaderValue::from_str(APUB_JSON_CONTENT_TYPE)?,
|
HeaderValue::from_str(APUB_JSON_CONTENT_TYPE)?,
|
||||||
);
|
);
|
||||||
headers.insert(HeaderName::from_str("Host")?, HeaderValue::from_str(&host)?);
|
headers.insert(HeaderName::from_str("Host")?, HeaderValue::from_str(&host)?);
|
||||||
// Need to use legacy timezone because mastodon and doesnt understand any new standards
|
|
||||||
let date = Utc::now().to_rfc2822().replace("+0000", "GMT");
|
|
||||||
headers.insert(HeaderName::from_str("Date")?, HeaderValue::from_str(&date)?);
|
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.post(&inbox_url.to_string())
|
.post(&inbox_url.to_string())
|
||||||
|
Loading…
Reference in New Issue
Block a user