diff --git a/src/http/server.rs b/src/http/server.rs index 9fb6ff4..c9a396c 100644 --- a/src/http/server.rs +++ b/src/http/server.rs @@ -19,7 +19,6 @@ //! [`http_server`]: crate::http_server use super::{Body, Error, Response, error::ErrorCode, fields::header_map_to_wasi}; -use http::header::CONTENT_LENGTH; use wasip2::exports::http::incoming_handler::ResponseOutparam; use wasip2::http::types::OutgoingResponse; @@ -44,14 +43,6 @@ impl Responder { // Consume the `response` and prepare to write the body. let body = response.into_body().into(); - // Automatically add a Content-Length header. - if let Some(len) = body.content_length() { - let mut buffer = itoa::Buffer::new(); - wasi_headers - .append(CONTENT_LENGTH.as_str(), buffer.format(len).as_bytes()) - .unwrap(); - } - let wasi_response = OutgoingResponse::new(wasi_headers); // Unwrap because `StatusCode` has already validated the status.