diff --git a/actix-http/src/h1/encoder.rs b/actix-http/src/h1/encoder.rs index 60bf2262b..61ca48b1d 100644 --- a/actix-http/src/h1/encoder.rs +++ b/actix-http/src/h1/encoder.rs @@ -82,7 +82,7 @@ pub(crate) trait MessageType: Sized { if camel_case { dst.put_slice(b"\r\nTransfer-Encoding: chunked\r\n") } else { - dst.put_slice(b"\r\nTransfer-Encoding: chunked\r\n") + dst.put_slice(b"\r\ntransfer-encoding: chunked\r\n") } } else { skip_len = false; @@ -564,5 +564,18 @@ mod tests { bytes.take().freeze(), Bytes::from_static(b"\r\nTransfer-Encoding: chunked\r\nDate: date\r\nContent-Type: xml\r\nContent-Type: plain/text\r\n\r\n") ); + + head.set_camel_case_headers(false); + let _ = head.encode_headers( + &mut bytes, + Version::HTTP_11, + BodySize::Stream, + ConnectionType::KeepAlive, + &ServiceConfig::default(), + ); + assert_eq!( + bytes.take().freeze(), + Bytes::from_static(b"\r\ntransfer-encoding: chunked\r\ndate: date\r\ncontent-type: xml\r\ncontent-type: plain/text\r\n\r\n") + ); } }