forked from neri/datatrash
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;
|
||||
|
||||
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…
Reference in New Issue