From 6ffaf5d582fe833500023e972f4bb55e87372c0c Mon Sep 17 00:00:00 2001 From: neri Date: Mon, 13 Jul 2020 16:08:55 +0200 Subject: [PATCH] use correct http semantic on upload redirect --- src/main.rs | 2 +- src/multipart.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 84037f1..83a50cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,7 +75,7 @@ async fn upload( sender.send(()).await; - Ok(HttpResponse::Found() + Ok(HttpResponse::SeeOther() .header("location", format!("/upload/{}", file_id)) .finish()) } diff --git a/src/multipart.rs b/src/multipart.rs index 63e7ecb..7942e21 100644 --- a/src/multipart.rs +++ b/src/multipart.rs @@ -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)