diff options
Diffstat (limited to 'src/listing.rs')
-rw-r--r-- | src/listing.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/listing.rs b/src/listing.rs index 58703c0..9e02598 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -1,4 +1,3 @@ -use actix_web::body::BoxBody; use actix_web::dev::ServiceResponse; use actix_web::web::Query; use actix_web::{HttpMessage, HttpRequest, HttpResponse}; @@ -15,7 +14,8 @@ use crate::archive::ArchiveMethod; use crate::auth::CurrentUser; use crate::errors::{self, ContextualError}; use crate::renderer; -use percent_encode_sets::PATH_SEGMENT; + +use self::percent_encode_sets::PATH_SEGMENT; /// "percent-encode sets" as defined by WHATWG specs: /// https://url.spec.whatwg.org/#percent-encoded-bytes @@ -157,7 +157,6 @@ pub fn directory_listing( let extensions = req.extensions(); let current_user: Option<&CurrentUser> = extensions.get::<CurrentUser>(); - use actix_web::dev::BodyEncoding; let conf = req.app_data::<crate::MiniserveConfig>().unwrap(); let serve_path = req.path(); @@ -358,7 +357,7 @@ pub fn directory_listing( req.clone(), HttpResponse::Ok() .content_type(archive_method.content_type()) - .encoding(archive_method.content_encoding()) + .append_header(archive_method.content_encoding()) .append_header(("Content-Transfer-Encoding", "binary")) .append_header(( "Content-Disposition", |