Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove header Content-Encoding when archiving #1290

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::fs::File;
use std::io::{Cursor, Read, Write};
use std::path::{Path, PathBuf};

use actix_web::http::header::ContentEncoding;
use libflate::gzip::Encoder;
use serde::Deserialize;
use strum::{Display, EnumIter, EnumString};
Expand Down Expand Up @@ -45,14 +44,6 @@ impl ArchiveMethod {
.to_string()
}

pub fn content_encoding(self) -> ContentEncoding {
match self {
ArchiveMethod::TarGz => ContentEncoding::Gzip,
ArchiveMethod::Tar => ContentEncoding::Identity,
ArchiveMethod::Zip => ContentEncoding::Identity,
}
}

pub fn is_enabled(self, tar_enabled: bool, tar_gz_enabled: bool, zip_enabled: bool) -> bool {
match self {
ArchiveMethod::TarGz => tar_gz_enabled,
Expand Down
1 change: 0 additions & 1 deletion src/listing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading