From d45a2a644185171dafb57ed4ade876f3cad191af Mon Sep 17 00:00:00 2001 From: Nutomic Date: Fri, 29 Sep 2023 17:20:14 +0200 Subject: [PATCH] Increase timeout for image upload to 30s (fixes #3920) (#3998) --- crates/routes/src/images.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/routes/src/images.rs b/crates/routes/src/images.rs index db3341418..a6ddf666f 100644 --- a/crates/routes/src/images.rs +++ b/crates/routes/src/images.rs @@ -21,6 +21,7 @@ use lemmy_utils::{rate_limit::RateLimitCell, REQWEST_TIMEOUT}; use reqwest::Body; use reqwest_middleware::{ClientWithMiddleware, RequestBuilder}; use serde::{Deserialize, Serialize}; +use std::time::Duration; pub fn config( cfg: &mut web::ServiceConfig, @@ -108,6 +109,7 @@ async fn upload( client_req = client_req.header("X-Forwarded-For", addr.to_string()) }; let res = client_req + .timeout(Duration::from_secs(30)) .body(Body::wrap_stream(make_send(body))) .send() .await