From: Dessalines Date: Wed, 5 Aug 2020 17:53:59 +0000 (-0400) Subject: Remove allowed thumbnail sizes for now. X-Git-Url: http://these/git/%22%7Burl%7D/%7B%60%24%7BghostArchiveUrl%7D/static/%7B%7D/inbox?a=commitdiff_plain;h=048271f59b99da8160362d13df5b80cce5c2e8ea;p=lemmy.git Remove allowed thumbnail sizes for now. --- diff --git a/server/src/routes/images.rs b/server/src/routes/images.rs index 8c94535a..766aff6e 100644 --- a/server/src/routes/images.rs +++ b/server/src/routes/images.rs @@ -5,8 +5,6 @@ use awc::Client; use lemmy_utils::settings::Settings; use serde::{Deserialize, Serialize}; -const THUMBNAIL_SIZES: &[u64] = &[256]; - pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimit) { let client = Client::build() .header("User-Agent", "pict-rs-frontend, v0.1.0") @@ -79,18 +77,14 @@ async fn thumbnail( ) -> Result { let (size, file) = parts.into_inner(); - if THUMBNAIL_SIZES.contains(&size) { - let url = format!( - "{}/image/thumbnail{}/{}", - Settings::get().pictrs_url, - size, - &file - ); - - return image(url, req, client).await; - } + let url = format!( + "{}/image/thumbnail{}/{}", + Settings::get().pictrs_url, + size, + &file + ); - Ok(HttpResponse::NotFound().finish()) + image(url, req, client).await } async fn image(