Skip to content

Commit

Permalink
rustup toolchain install nightly (ftw)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam365724 authored and dessalines committed Oct 28, 2022
1 parent 7dac946 commit f24678f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/routes/src/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ use actix_web::{
HttpResponse,
};
use futures::stream::{Stream, StreamExt};
use lemmy_api_common::utils::{blocking, get_local_user_view_from_jwt};
use lemmy_db_schema::source::site::Site;
use lemmy_utils::{claims::Claims, rate_limit::RateLimit, REQWEST_TIMEOUT};
use lemmy_websocket::LemmyContext;
use reqwest::Body;
use reqwest_middleware::{ClientWithMiddleware, RequestBuilder};
use serde::{Deserialize, Serialize};
use lemmy_api_common::{utils::blocking};
use lemmy_db_schema::{ source::{ site::Site }};
use lemmy_api_common::{
utils::{get_local_user_view_from_jwt},
};

pub fn config(cfg: &mut web::ServiceConfig, client: ClientWithMiddleware, rate_limit: &RateLimit) {
cfg
Expand Down Expand Up @@ -134,9 +131,12 @@ async fn full_res(
if let Ok(site) = site {
if site.private_instance {
let jwt = req
.cookie("jwt")
.expect("No auth header for picture access");
if get_local_user_view_from_jwt(jwt.value(), context.pool(), context.secret()).await.is_err() {
.cookie("jwt")
.expect("No auth header for picture access");
if get_local_user_view_from_jwt(jwt.value(), context.pool(), context.secret())
.await
.is_err()
{
return Ok(HttpResponse::Unauthorized().finish());
};
}
Expand Down

0 comments on commit f24678f

Please sign in to comment.