apply suggestion

This commit is contained in:
zuisong 2025-02-12 16:13:33 +08:00
parent e9a386f460
commit 670a5ba096
No known key found for this signature in database
GPG Key ID: A617F31AFE6F5E8D
2 changed files with 2 additions and 1 deletions

View File

@ -187,7 +187,7 @@ Example: --print=Hb"
///
/// Compression is skipped if it appears that compression ratio is negative.
/// Compression can be forced by repeating this option.
/// Note: Compression cannot be forced if the Content-Encoding request header is present.
/// Note: Compression cannot be used if the Content-Encoding request header is present.
#[clap(short = 'x', long = "compress", name = "compress", action = ArgAction::Count)]
pub compress: u8,

View File

@ -512,6 +512,7 @@ fn run(args: Cli) -> Result<i32> {
if args.compress >= 1 {
if request.headers().contains_key(CONTENT_ENCODING) {
// HTTPie overrides the original Content-Encoding header in this case
log::warn!("--compress can't be used with a 'Content-Encoding:' header. --compress will be disabled.");
} else if let Some(body) = request.body_mut() {
// TODO: Compress file body (File) without buffering