fix(headers): only add chunked to TransferEncoding if not present
This commit is contained in:
@@ -188,8 +188,9 @@ impl Http1Message for ClientMessage {
|
|||||||
body = Encoder::chunked();
|
body = Encoder::chunked();
|
||||||
let encodings = match head.headers.get_mut::<TransferEncoding>() {
|
let encodings = match head.headers.get_mut::<TransferEncoding>() {
|
||||||
Some(encodings) => {
|
Some(encodings) => {
|
||||||
//TODO: check if Chunked already exists
|
if !encodings.contains(&header::Encoding::Chunked) {
|
||||||
encodings.push(header::Encoding::Chunked);
|
encodings.push(header::Encoding::Chunked);
|
||||||
|
}
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
None => false
|
None => false
|
||||||
|
|||||||
Reference in New Issue
Block a user