From 5bcfa4ac832a9457ed32ff377febf6e284c5e1d5 Mon Sep 17 00:00:00 2001 From: Sheepy Date: Sat, 25 Jun 2022 19:02:02 -0500 Subject: Create directory (#781) * Add ability to make directory Frontend for making directories Fix potential security vulnerability (CWE-23) Add tests Update README.md Disallow using parent directories altogether Fix formatting Fix clippy warnings Address review comments Update README.md Change `making` to `creation` Co-authored-by: Sven-Hendrik Haase Have make directory flag require file upload flag Address review comments * Disallow uploading files and making directories through symlinks when disabled * Add test * Clippy formatting changes * Add test doc comment --- src/config.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index deec606..2ee014f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -81,6 +81,9 @@ pub struct MiniserveConfig { /// Enable QR code display pub show_qrcode: bool, + /// Enable creating directories + pub mkdir_enabled: bool, + /// Enable file upload pub file_upload: bool, @@ -228,6 +231,7 @@ impl MiniserveConfig { spa: args.spa, overwrite_files: args.overwrite_files, show_qrcode: args.qrcode, + mkdir_enabled: args.mkdir_enabled, file_upload: args.file_upload, uploadable_media_type, tar_enabled: args.enable_tar, -- cgit v1.2.3