Skip to content

Commit

Permalink
http1 expose ignore_invalid_headers_in_requests opt
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDC committed Jan 9, 2025
1 parent e981a91 commit ac9d487
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ futures-channel = { version = "0.3", optional = true }
futures-util = { version = "0.3", default-features = false, optional = true }
h2 = { version = "0.4.2", optional = true }
http-body-util = { version = "0.1", optional = true }
httparse = { version = "1.8", optional = true }
httparse = { version = "1.9", optional = true }
httpdate = { version = "1.0", optional = true }
itoa = { version = "1", optional = true }
pin-project-lite = { version = "0.2.4", optional = true }
Expand Down
13 changes: 13 additions & 0 deletions src/client/conn/http1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,19 @@ impl Builder {
self
}

/// Set whether HTTP/1 connections will silently ignored malformed header lines.
///
/// If this is enabled and a header line does not start with a valid header
/// name, or does not include a colon at all, the line will be silently ignored
/// and no error will be reported.
///
/// Default is false.
pub fn ignore_invalid_headers_in_requests(&mut self, enabled: bool) -> &mut Builder {
self.h1_parser_config
.ignore_invalid_headers_in_requests(enabled);
self
}

/// Set whether HTTP/1 connections should try to use vectored writes,
/// or always flatten into a single buffer.
///
Expand Down

0 comments on commit ac9d487

Please sign in to comment.