-
-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proxy pictrs in request.rs (fixes #5270)
- Loading branch information
Showing
8 changed files
with
49 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
use actix_web::web::*; | ||
use lemmy_api_common::{context::LemmyContext, SuccessResponse}; | ||
use lemmy_utils::error::LemmyResult; | ||
use reqwest_middleware::ClientWithMiddleware; | ||
|
||
pub mod delete; | ||
pub mod download; | ||
pub mod upload; | ||
mod utils; | ||
|
||
pub async fn pictrs_health( | ||
client: Data<ClientWithMiddleware>, | ||
context: Data<LemmyContext>, | ||
) -> LemmyResult<Json<SuccessResponse>> { | ||
pub async fn pictrs_health(context: Data<LemmyContext>) -> LemmyResult<Json<SuccessResponse>> { | ||
let pictrs_config = context.settings().pictrs()?; | ||
let url = format!("{}healthz", pictrs_config.url); | ||
|
||
client.get(url).send().await?.error_for_status()?; | ||
context | ||
.pictrs_client() | ||
.get(url) | ||
.send() | ||
.await? | ||
.error_for_status()?; | ||
|
||
Ok(Json(SuccessResponse::default())) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters