aboutsummaryrefslogtreecommitdiffstats
path: root/src/file_upload.rs
diff options
context:
space:
mode:
authorjikstra <jikstra@disroot.org>2021-12-27 23:28:27 +0000
committerjikstra <jikstra@disroot.org>2021-12-28 02:21:50 +0000
commit00598acb2197b8f86dd03c0d79e016882b6a96cd (patch)
tree75150f5f3fa342a8dbfe7de55fcbed8999dcf27c /src/file_upload.rs
parentBump actix-web to v4.0-beta.9 (diff)
downloadminiserve-00598acb2197b8f86dd03c0d79e016882b6a96cd.tar.gz
miniserve-00598acb2197b8f86dd03c0d79e016882b6a96cd.zip
Bump actix-web to v4.0-beta.15
Co-authored-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
Diffstat (limited to 'src/file_upload.rs')
-rw-r--r--src/file_upload.rs15
1 files changed, 6 insertions, 9 deletions
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<u64, ContextualError> {
- 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())