From 00598acb2197b8f86dd03c0d79e016882b6a96cd Mon Sep 17 00:00:00 2001 From: jikstra Date: Tue, 28 Dec 2021 00:28:27 +0100 Subject: Bump actix-web to v4.0-beta.15 Co-authored-by: Ali MJ Al-Nasrawy --- src/file_upload.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/file_upload.rs') diff --git a/src/file_upload.rs b/src/file_upload.rs index 5009f36..0d4b8a5 100644 --- a/src/file_upload.rs +++ b/src/file_upload.rs @@ -43,15 +43,12 @@ async fn handle_multipart( path: PathBuf, overwrite_files: bool, ) -> Result { - let filename = field - .content_disposition() - .and_then(|cd| cd.get_filename().map(String::from)) - .ok_or_else(|| { - ContextualError::ParseError( - "HTTP header".to_string(), - "Failed to retrieve the name of the file to upload".to_string(), - ) - })?; + let filename = field.content_disposition().get_filename().ok_or_else(|| { + ContextualError::ParseError( + "HTTP header".to_string(), + "Failed to retrieve the name of the file to upload".to_string(), + ) + })?; let filename = sanitize_path(Path::new(&filename), false).ok_or_else(|| { ContextualError::InvalidPathError("Invalid file name to upload".to_string()) -- cgit v1.2.3