From 5440794ac9268d82f100ac0565f1a1ed815d83aa Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Fri, 14 Jun 2019 09:43:09 -0700 Subject: Enable streaming tarball download Also add a non-compressed tar option --- src/main.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/main.rs') 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(); -- cgit v1.2.3