From affc7c0923c2eeb70a0a48b0704f91801d5bcc47 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Fri, 19 Dec 2025 23:27:38 +0200 Subject: [PATCH] Reject uploads missing path before file0 --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index c3c27eb..8c9c5d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -576,6 +576,12 @@ async fn ax_post_file( } } } else if name == "file0" { + if path.is_empty() { + let error_msg = "Missing path field before file0".to_string(); + eprintln!("{}", error_msg); + upload_result = Some((StatusCode::BAD_REQUEST, error_msg.into_bytes())); + break; + } match filename { Some(fname) => { file0_filename = fname.to_string();