aboutsummaryrefslogtreecommitdiffstats
path: root/src/file_upload.rs
diff options
context:
space:
mode:
authorJonas Diemer <jonasdiemer@gmail.com>2022-08-04 09:20:37 +0000
committerJonas Diemer <jonasdiemer@gmail.com>2022-09-18 18:25:35 +0000
commit550ae0151c1dadc6c1f00df300d88528c29fbf49 (patch)
treee533fdef6284f8c3f55e521f2c08f93d546d4a8c /src/file_upload.rs
parentAvoid error message during testing of restricted (diff)
downloadminiserve-550ae0151c1dadc6c1f00df300d88528c29fbf49.tar.gz
miniserve-550ae0151c1dadc6c1f00df300d88528c29fbf49.zip
Renamed option for more clarity
Diffstat (limited to 'src/file_upload.rs')
-rw-r--r--src/file_upload.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/file_upload.rs b/src/file_upload.rs
index e5f6173..231999f 100644
--- a/src/file_upload.rs
+++ b/src/file_upload.rs
@@ -173,9 +173,8 @@ pub async fn upload_file(
// Disallow paths outside of restricted directories
- // TODO: Probably not the most rust-ic style...
- let upload_allowed = conf.restrict_upload_dir.is_empty() ||
- conf.restrict_upload_dir.iter().any(|s| upload_path.starts_with(s));
+ let upload_allowed = conf.allowed_upload_dir.is_empty() ||
+ conf.allowed_upload_dir.iter().any(|s| upload_path.starts_with(s));
if !(upload_allowed) {
return Err(ContextualError::InvalidPathError("Not allowed to upload to this path".to_string()));