Remove allowed thumbnail sizes for now.

pull/1048/head
Dessalines 2020-08-05 13:53:59 -04:00
parent 88bd368660
commit 048271f59b
1 changed files with 7 additions and 13 deletions

View File

@ -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,7 +77,6 @@ async fn thumbnail(
) -> Result<HttpResponse, Error> {
let (size, file) = parts.into_inner();
if THUMBNAIL_SIZES.contains(&size) {
let url = format!(
"{}/image/thumbnail{}/{}",
Settings::get().pictrs_url,
@ -87,10 +84,7 @@ async fn thumbnail(
&file
);
return image(url, req, client).await;
}
Ok(HttpResponse::NotFound().finish())
image(url, req, client).await
}
async fn image(