From b5d8842cccb4505e44668e54e0e705aa2d287984 Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 13 Jun 2023 23:47:06 -0300 Subject: [PATCH] warn for non-image path --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0cf41c2..fa0e5f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -396,6 +396,10 @@ async fn upload_file( let response = WrappedResponse::Tags(final_tag_set.into_iter().collect::>()); Ok((StatusCode::OK, Json(response))) } else { + if !file_type.starts_with("image/") { + log::warn!("warning: mimetype {} is not image/", file_type); + } + let json_response = send_image_to_dd(file_contents.to_vec(), file_name, &file_type, &options).await?; Ok((StatusCode::OK, Json(json_response)))