This commit is contained in:
Timofey Gelazoniya 2023-07-13 23:14:44 +03:00
parent 5e70207c5d
commit e39a4ab897
Signed by: zeldon
GPG Key ID: 047886915281DD2A
1 changed files with 1 additions and 6 deletions

View File

@ -55,12 +55,7 @@ async fn handle_request(mut payload: Multipart) -> Result<Response<Full<Bytes>>,
let mut data: Vec<u8> = Vec::new();
while let Some(field) = payload.next_field().await.unwrap() {
let content_type = field.content_type().unwrap();
match content_type {
"image/jpeg" | "image/png" => data = field.bytes().await.unwrap().to_vec(),
_ => return Err(StatusCode::UNSUPPORTED_MEDIA_TYPE.into_response()),
}
data = field.bytes().await.unwrap().to_vec();
}
START.call_once(|| magick_wand_genesis());