From 9a6ecd74151814aee435bc039c45f6c932ead7c2 Mon Sep 17 00:00:00 2001 From: Whyme Lyu Date: Mon, 11 Dec 2023 18:11:16 +0800 Subject: Remove header Content-Encoding when archiving Content-Encoding is a representation header which kinda means "same content, presented differently to different clients" or "encoded & decoded on-the-fly, guided by content negotiation". In the case of downloading an archive, MDN docs explicitly says that (quoted from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding): > If the original media is encoded in some way (e.g. a zip file) then this > information would not be included in the Content-Encoding header. Thus this patch. Also fixes !1187. --- src/listing.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/listing.rs') diff --git a/src/listing.rs b/src/listing.rs index a8feeb4..eb9b2be 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -363,7 +363,6 @@ pub fn directory_listing( req.clone(), HttpResponse::Ok() .content_type(archive_method.content_type()) - .append_header(archive_method.content_encoding()) .append_header(("Content-Transfer-Encoding", "binary")) .append_header(( "Content-Disposition", -- cgit v1.2.3