mirror of
https://github.com/ducaale/xh.git
synced 2025-05-05 15:32:50 +00:00
update help doc
This commit is contained in:
parent
abc8c03b10
commit
53e7bbd88a
4
doc/xh.1
4
doc/xh.1
@ -1,4 +1,4 @@
|
||||
.TH XH 1 2025-01-23 0.23.1 "User Commands"
|
||||
.TH XH 1 2025-02-04 0.23.1 "User Commands"
|
||||
|
||||
.SH NAME
|
||||
xh \- Friendly and fast tool for sending HTTP requests
|
||||
@ -191,7 +191,7 @@ Always stream the response body.
|
||||
\fB\-x\fR, \fB\-\-compress\fR
|
||||
Content compressed (encoded) with Deflate algorithm. The Content\-Encoding header is set to deflate.
|
||||
|
||||
Compression is skipped if it appears that compression ratio is negative. Compression can be forced by repeating this option.
|
||||
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.
|
||||
.TP 4
|
||||
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
|
||||
Save output to FILE instead of stdout.
|
||||
|
@ -187,6 +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.
|
||||
#[clap(short = 'x', long = "compress", name = "compress", action = ArgAction::Count)]
|
||||
pub compress: u8,
|
||||
|
||||
|
@ -512,6 +512,7 @@ fn run(args: Cli) -> Result<i32> {
|
||||
|
||||
if args.compress >= 1 && request.headers().get(CONTENT_ENCODING).is_none() {
|
||||
if let Some(body) = request.body_mut() {
|
||||
// TODO: Compress file body (Multipart and File) without buffering
|
||||
let body_bytes = body.buffer()?;
|
||||
let mut encoder = ZlibEncoder::new(Vec::new(), Default::default());
|
||||
encoder.write_all(body_bytes)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user