Skip to content

Commit

Permalink
fix(http1): make date_header effective (#3718)
Browse files Browse the repository at this point in the history
Before this patch, the option was not fully propagated to the inner server conn state object. Now it is.
  • Loading branch information
yhx-12243 authored Jul 31, 2024
1 parent 2babc93 commit 7de0237
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/proto/h1/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
3 changes: 3 additions & 0 deletions src/server/conn/http1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 7de0237

Please sign in to comment.