mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-16 09:24:00 +00:00
Make http signature compatible with mastodon
This commit is contained in:
parent
579ca37ddf
commit
dc416bf255
1 changed files with 3 additions and 4 deletions
|
@ -44,10 +44,9 @@ 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)?);
|
||||||
headers.insert(
|
// Need to use legacy timezone because mastodon and doesnt understand any new standards
|
||||||
HeaderName::from_str("Date")?,
|
let date = Utc::now().to_rfc2822().replace("+0000", "GMT");
|
||||||
HeaderValue::from_str(&Utc::now().to_rfc2822())?,
|
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 a new issue