use correct http semantic on upload redirect

This commit is contained in:
neri 2020-07-13 16:08:55 +02:00
parent 42a3d61db8
commit 6ffaf5d582
2 changed files with 1 additions and 3 deletions

View File

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

View File

@ -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)