aboutsummaryrefslogtreecommitdiffstats
path: root/src/file_upload.rs
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2022-02-06 09:27:01 +0000
committerGitHub <noreply@github.com>2022-02-06 09:27:01 +0000
commitaa773795460214966bffee4edb4f35036ad8a6de (patch)
tree608ce6228a5e77c729e75a05a2b62eba0b876032 /src/file_upload.rs
parentMerge pull request #726 from svenstaro/use-custom-freebsd-image (diff)
parentupdate to actix-web v4.0-rc.2 (diff)
downloadminiserve-aa773795460214966bffee4edb4f35036ad8a6de.tar.gz
miniserve-aa773795460214966bffee4edb4f35036ad8a6de.zip
Merge pull request #725 from aliemjay/update_actix_web
Update actix web to v4.0.0-rc.2
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())