Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
n1haldev authored Aug 7, 2024
2 parents a2cc481 + 60e5088 commit 047a0cf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ jobs:

- uses: Swatinem/rust-cache@v2

- name: Pin some dependencies
run: |
cargo update -p tokio --precise 1.38.1
- name: Check
run: cargo check --features full

Expand Down Expand Up @@ -201,12 +205,12 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Install cbindgen
uses: taiki-e/cache-cargo-install-action@v1
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cbindgen

- name: Install cargo-expand
uses: taiki-e/cache-cargo-install-action@v1
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-expand

Expand Down Expand Up @@ -250,7 +254,7 @@ jobs:
toolchain: nightly-2024-05-01 # Compatible version for cargo-check-external-types

- name: Install cargo-check-external-types
uses: taiki-e/cache-cargo-install-action@v1
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-check-external-types@0.1.12

Expand Down
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
5 changes: 5 additions & 0 deletions src/service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ pub trait Service<Request> {
type Response;

/// Errors produced by the service.
///
/// Note: Returning an `Error` to a hyper server, the behavior depends on the
/// protocol. In most cases, hyper will cause the connection to be abruptly aborted.
/// It will abort the request however the protocol allows, either with some sort of RST_STREAM,
/// or killing the connection if that doesn't exist.
type Error;

/// The future response value.
Expand Down

0 comments on commit 047a0cf

Please sign in to comment.