use correct http semantic on upload redirect

pull/3/head
neri 2 years ago
parent 42a3d61db8
commit 6ffaf5d582
  1. 2
      src/main.rs
  2. 2
      src/multipart.rs

@ -75,7 +75,7 @@ async fn upload(
sender.send(()).await;
Ok(HttpResponse::Found()
Ok(HttpResponse::SeeOther()
.header("location", format!("/upload/{}", file_id))
.finish())
}

@ -26,7 +26,6 @@ pub(crate) async fn parse_multipart(
if file_original_name == None || file_original_name.as_deref() == Some("") {
continue;
}
println!("got content");
original_name = file_original_name;
kind = Some(FileKind::BINARY);
let mut file = fs::File::create(&filename)
@ -40,7 +39,6 @@ pub(crate) async fn parse_multipart(
if original_name.is_some() {
continue;
}
println!("got text content");
original_name = Some(format!("{}.txt", file_id));
kind = Some(FileKind::TEXT);
let mut file = fs::File::create(&filename)

Loading…
Cancel
Save