From 46932e7d5664c97ad65aefc3f670f7e64e6f8e0d Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Fri, 8 Mar 2019 23:57:05 +0100 Subject: Improved HTTP headers --- src/listing.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/listing.rs') diff --git a/src/listing.rs b/src/listing.rs index c9542b8..f7198a5 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -230,8 +230,9 @@ pub fn directory_listing( if let Some(compression_method) = &download { match archive::create_archive_file(&compression_method, &dir.path) { Ok((filename, content)) => Ok(HttpResponse::Ok() - .content_type("application/tar") + .content_type(compression_method.content_type()) .content_length(content.len() as u64) + .content_encoding(compression_method.content_encoding()) .header("Content-Transfer-Encoding", "binary") .header( "Content-Disposition", -- cgit v1.2.3