From c35d2946119448ff1222e9963b4257db1038d1ed Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 21 Dec 2017 12:54:18 -0800 Subject: [PATCH] fix compression --- src/encoding.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/encoding.rs b/src/encoding.rs index 85cd7fd6..4e942799 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -394,7 +394,8 @@ impl PayloadEncoder { }, Body::Binary(ref mut bytes) => { if compression { - let transfer = TransferEncoding::eof(SharedBytes::default()); + let mut buf = SharedBytes::default(); + let transfer = TransferEncoding::eof(buf.clone()); let mut enc = match encoding { ContentEncoding::Deflate => ContentEncoder::Deflate( DeflateEncoder::new(transfer, Compression::Default)),