diff --git a/src/proto/h1/conn.rs b/src/proto/h1/conn.rs index 744e1b2ae5..10f4f87b40 100644 --- a/src/proto/h1/conn.rs +++ b/src/proto/h1/conn.rs @@ -152,6 +152,11 @@ where self.state.allow_half_close = true; } + #[cfg(feature = "server")] + pub(crate) fn disable_date_header(&mut self) { + self.state.date_header = false; + } + pub(crate) fn into_inner(self) -> (I, Bytes) { self.io.into_inner() } diff --git a/src/server/conn/http1.rs b/src/server/conn/http1.rs index a1e3325785..097497bf41 100644 --- a/src/server/conn/http1.rs +++ b/src/server/conn/http1.rs @@ -459,6 +459,9 @@ impl Builder { if let Some(max) = self.max_buf_size { conn.set_max_buf_size(max); } + if !self.date_header { + conn.disable_date_header(); + } let sd = proto::h1::dispatch::Server::new(service); let proto = proto::h1::Dispatcher::new(sd, conn); Connection { conn: proto }