mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-10 19:14:55 +00:00
optimization
Co-authored-by: dullbananas <dull.bananas0@gmail.com>
This commit is contained in:
parent
6f91754f99
commit
4d51f5311e
1 changed files with 5 additions and 3 deletions
|
@ -24,9 +24,11 @@ pub async fn get_image(
|
|||
local_user_view: Option<LocalUserView>,
|
||||
) -> LemmyResult<HttpResponse> {
|
||||
// block access to images if instance is private and unauthorized, public
|
||||
let local_site = LocalSite::read(&mut context.pool()).await?;
|
||||
if local_site.private_instance && local_user_view.is_none() {
|
||||
return Ok(HttpResponse::Unauthorized().finish());
|
||||
if local_user_view.is_none() {
|
||||
let local_site = LocalSite::read(&mut context.pool()).await?;
|
||||
if local_site.private_instance {
|
||||
return Ok(HttpResponse::Unauthorized().finish());
|
||||
}
|
||||
}
|
||||
let name = &filename.into_inner();
|
||||
|
||||
|
|
Loading…
Reference in a new issue