mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
parent
210c470ebd
commit
d45a2a6441
@ -21,6 +21,7 @@ use lemmy_utils::{rate_limit::RateLimitCell, REQWEST_TIMEOUT};
|
|||||||
use reqwest::Body;
|
use reqwest::Body;
|
||||||
use reqwest_middleware::{ClientWithMiddleware, RequestBuilder};
|
use reqwest_middleware::{ClientWithMiddleware, RequestBuilder};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::time::Duration;
|
||||||
|
|
||||||
pub fn config(
|
pub fn config(
|
||||||
cfg: &mut web::ServiceConfig,
|
cfg: &mut web::ServiceConfig,
|
||||||
@ -108,6 +109,7 @@ async fn upload(
|
|||||||
client_req = client_req.header("X-Forwarded-For", addr.to_string())
|
client_req = client_req.header("X-Forwarded-For", addr.to_string())
|
||||||
};
|
};
|
||||||
let res = client_req
|
let res = client_req
|
||||||
|
.timeout(Duration::from_secs(30))
|
||||||
.body(Body::wrap_stream(make_send(body)))
|
.body(Body::wrap_stream(make_send(body)))
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
|
Loading…
Reference in New Issue
Block a user