mirror of https://github.com/LemmyNet/lemmy.git
Add timeout for sending activities
parent
0d957a2a27
commit
c416efdc0d
|
@ -15,7 +15,7 @@ use reqwest::Response;
|
||||||
use reqwest_middleware::ClientWithMiddleware;
|
use reqwest_middleware::ClientWithMiddleware;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use std::str::FromStr;
|
use std::{str::FromStr, time::Duration};
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@ pub async fn sign_and_send(
|
||||||
|
|
||||||
let request = client
|
let request = client
|
||||||
.post(&inbox_url.to_string())
|
.post(&inbox_url.to_string())
|
||||||
|
// signature is only valid for 10 seconds, so no reason to wait any longer
|
||||||
|
.timeout(Duration::from_secs(10))
|
||||||
.headers(headers)
|
.headers(headers)
|
||||||
.signature_with_digest(
|
.signature_with_digest(
|
||||||
HTTP_SIG_CONFIG.clone(),
|
HTTP_SIG_CONFIG.clone(),
|
||||||
|
|
Loading…
Reference in New Issue