Skip to content

Commit

Permalink
fix(headers): only add chunked to TransferEncoding if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Jun 17, 2016
1 parent 43ac0dd commit 1b4f857
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/http/h1/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ impl Http1Message for ClientMessage {
body = Encoder::chunked();
let encodings = match head.headers.get_mut::<TransferEncoding>() {
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
Expand Down

0 comments on commit 1b4f857

Please sign in to comment.