aboutsummaryrefslogtreecommitdiffstats
path: root/src/file_upload.rs
diff options
context:
space:
mode:
authorJonas Diemer <jonasdiemer@gmail.com>2022-09-19 14:43:50 +0000
committerJonas Diemer <jonasdiemer@gmail.com>2022-09-19 14:43:50 +0000
commit20a055dd82b009e94b1aa681cc4329f17e552f44 (patch)
tree5e01f1cc32283ffdb2ab87cf6b858f0431665afd /src/file_upload.rs
parentFixed clippy issue (single-char string to char) (diff)
downloadminiserve-20a055dd82b009e94b1aa681cc4329f17e552f44.tar.gz
miniserve-20a055dd82b009e94b1aa681cc4329f17e552f44.zip
Return 403 instead of 500 for upload errs
Diffstat (limited to '')
-rw-r--r--src/file_upload.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/file_upload.rs b/src/file_upload.rs
index 0232c7e..cf214b8 100644
--- a/src/file_upload.rs
+++ b/src/file_upload.rs
@@ -179,9 +179,7 @@ pub async fn upload_file(
.any(|s| upload_path.starts_with(s));
if !upload_allowed {
- return Err(ContextualError::InvalidPathError(
- "Not allowed to upload to this path".to_string(),
- ));
+ return Err(ContextualError::UploadForbiddenError);
}
// Disallow the target path to go outside of the served directory