Skip to content

Commit 7de0237

Browse files
authored
fix(http1): make date_header effective (#3718)
Before this patch, the option was not fully propagated to the inner server conn state object. Now it is.
1 parent 2babc93 commit 7de0237

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/proto/h1/conn.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ where
152152
self.state.allow_half_close = true;
153153
}
154154

155+
#[cfg(feature = "server")]
156+
pub(crate) fn disable_date_header(&mut self) {
157+
self.state.date_header = false;
158+
}
159+
155160
pub(crate) fn into_inner(self) -> (I, Bytes) {
156161
self.io.into_inner()
157162
}

src/server/conn/http1.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ impl Builder {
459459
if let Some(max) = self.max_buf_size {
460460
conn.set_max_buf_size(max);
461461
}
462+
if !self.date_header {
463+
conn.disable_date_header();
464+
}
462465
let sd = proto::h1::dispatch::Server::new(service);
463466
let proto = proto::h1::Dispatcher::new(sd, conn);
464467
Connection { conn: proto }

0 commit comments

Comments
 (0)