diff options
author | Dean Li <deantvv@gmail.com> | 2021-04-11 03:00:16 +0000 |
---|---|---|
committer | Dean Li <deantvv@gmail.com> | 2021-04-11 03:00:16 +0000 |
commit | 2bae301ed8efcf4239849a45b94cdc42e398b905 (patch) | |
tree | 06cfbebfc33cca930a80b9c080de3af1dcfdc815 /src/listing.rs | |
parent | Merge pull request #488 from svenstaro/dependabot/cargo/http-0.2.4 (diff) | |
download | miniserve-2bae301ed8efcf4239849a45b94cdc42e398b905.tar.gz miniserve-2bae301ed8efcf4239849a45b94cdc42e398b905.zip |
Separate tar archive and tar flags
It used to have one flag (-r) to enable both tar archive and tar.
Now it has two flags [ -r: for tar, -g: for tar archive].
Related to #451
Diffstat (limited to 'src/listing.rs')
-rw-r--r-- | src/listing.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/listing.rs b/src/listing.rs index 66aea6b..868817c 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -158,6 +158,7 @@ pub fn directory_listing( show_qrcode: bool, upload_route: String, tar_enabled: bool, + tar_archive_enabled: bool, zip_enabled: bool, dirs_first: bool, hide_version_footer: bool, @@ -330,7 +331,7 @@ pub fn directory_listing( } if let Some(compression_method) = query_params.download { - if !compression_method.is_enabled(tar_enabled, zip_enabled) { + if !compression_method.is_enabled(tar_enabled, tar_archive_enabled, zip_enabled) { return Ok(ServiceResponse::new( req.clone(), HttpResponse::Forbidden() @@ -413,6 +414,7 @@ pub fn directory_listing( &encoded_dir, breadcrumbs, tar_enabled, + tar_archive_enabled, zip_enabled, hide_version_footer, ) |