diff options
author | Alexandre Bury <alexandre.bury@gmail.com> | 2019-06-14 16:43:09 +0000 |
---|---|---|
committer | Alexandre Bury <alexandre.bury@gmail.com> | 2019-06-14 21:50:00 +0000 |
commit | 5440794ac9268d82f100ac0565f1a1ed815d83aa (patch) | |
tree | c569a459bff8a287e7ce1ab154fc46d4c0f77d7d /src/main.rs | |
parent | Update deps (diff) | |
download | miniserve-5440794ac9268d82f100ac0565f1a1ed815d83aa.tar.gz miniserve-5440794ac9268d82f100ac0565f1a1ed815d83aa.zip |
Enable streaming tarball download
Also add a non-compressed tar option
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index f26369a..ddf25e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,7 @@ mod auth; mod errors; mod file_upload; mod listing; +mod pipe; mod renderer; mod themes; @@ -79,17 +80,21 @@ fn run() -> Result<(), ContextualError> { TermLogger::init(LevelFilter::Error, Config::default()) }; - if miniserve_config.no_symlinks - && miniserve_config + if miniserve_config.no_symlinks { + let is_symlink = miniserve_config .path .symlink_metadata() - .map_err(|e| ContextualError::IOError("Failed to retrieve symlink's metadata".to_string(), e))? + .map_err(|e| { + ContextualError::IOError("Failed to retrieve symlink's metadata".to_string(), e) + })? .file_type() - .is_symlink() - { - return Err(ContextualError::from( - "The no-symlinks option cannot be used with a symlink path".to_string(), - )); + .is_symlink(); + + if is_symlink { + return Err(ContextualError::from( + "The no-symlinks option cannot be used with a symlink path".to_string(), + )); + } } let inside_config = miniserve_config.clone(); |