Skip to content

Commit 8d28129

Browse files
committed
Reject uploads missing path before file0
1 parent c51e1b5 commit 8d28129

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@ async fn ax_post_file(
576576
}
577577
}
578578
} else if name == "file0" {
579+
if path.is_empty() {
580+
let error_msg = "Missing path field before file0".to_string();
581+
eprintln!("{}", error_msg);
582+
upload_result = Some((StatusCode::BAD_REQUEST, error_msg.into_bytes()));
583+
break;
584+
}
579585
match filename {
580586
Some(fname) => {
581587
file0_filename = fname.to_string();

0 commit comments

Comments
 (0)