use correct http semantic on upload redirect
This commit is contained in:
parent
42a3d61db8
commit
6ffaf5d582
|
@ -75,7 +75,7 @@ async fn upload(
|
||||||
|
|
||||||
sender.send(()).await;
|
sender.send(()).await;
|
||||||
|
|
||||||
Ok(HttpResponse::Found()
|
Ok(HttpResponse::SeeOther()
|
||||||
.header("location", format!("/upload/{}", file_id))
|
.header("location", format!("/upload/{}", file_id))
|
||||||
.finish())
|
.finish())
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,6 @@ pub(crate) async fn parse_multipart(
|
||||||
if file_original_name == None || file_original_name.as_deref() == Some("") {
|
if file_original_name == None || file_original_name.as_deref() == Some("") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
println!("got content");
|
|
||||||
original_name = file_original_name;
|
original_name = file_original_name;
|
||||||
kind = Some(FileKind::BINARY);
|
kind = Some(FileKind::BINARY);
|
||||||
let mut file = fs::File::create(&filename)
|
let mut file = fs::File::create(&filename)
|
||||||
|
@ -40,7 +39,6 @@ pub(crate) async fn parse_multipart(
|
||||||
if original_name.is_some() {
|
if original_name.is_some() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
println!("got text content");
|
|
||||||
original_name = Some(format!("{}.txt", file_id));
|
original_name = Some(format!("{}.txt", file_id));
|
||||||
kind = Some(FileKind::TEXT);
|
kind = Some(FileKind::TEXT);
|
||||||
let mut file = fs::File::create(&filename)
|
let mut file = fs::File::create(&filename)
|
||||||
|
|
Loading…
Reference in New Issue