From 1b4f85799737a537d8ebfb6afd0423b97238ab8b Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Fri, 17 Jun 2016 03:52:01 -0700 Subject: [PATCH] fix(headers): only add chunked to TransferEncoding if not present --- src/http/h1/parse.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/http/h1/parse.rs b/src/http/h1/parse.rs index 4c08e80a8b..07867b3d29 100644 --- a/src/http/h1/parse.rs +++ b/src/http/h1/parse.rs @@ -188,8 +188,9 @@ impl Http1Message for ClientMessage { body = Encoder::chunked(); let encodings = match head.headers.get_mut::() { Some(encodings) => { - //TODO: check if Chunked already exists - encodings.push(header::Encoding::Chunked); + if !encodings.contains(&header::Encoding::Chunked) { + encodings.push(header::Encoding::Chunked); + } true }, None => false