Skip to content

Commit ac9d487

Browse files
committed
http1 expose ignore_invalid_headers_in_requests opt
1 parent e981a91 commit ac9d487

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ futures-channel = { version = "0.3", optional = true }
3131
futures-util = { version = "0.3", default-features = false, optional = true }
3232
h2 = { version = "0.4.2", optional = true }
3333
http-body-util = { version = "0.1", optional = true }
34-
httparse = { version = "1.8", optional = true }
34+
httparse = { version = "1.9", optional = true }
3535
httpdate = { version = "1.0", optional = true }
3636
itoa = { version = "1", optional = true }
3737
pin-project-lite = { version = "0.2.4", optional = true }

src/client/conn/http1.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,19 @@ impl Builder {
402402
self
403403
}
404404

405+
/// Set whether HTTP/1 connections will silently ignored malformed header lines.
406+
///
407+
/// If this is enabled and a header line does not start with a valid header
408+
/// name, or does not include a colon at all, the line will be silently ignored
409+
/// and no error will be reported.
410+
///
411+
/// Default is false.
412+
pub fn ignore_invalid_headers_in_requests(&mut self, enabled: bool) -> &mut Builder {
413+
self.h1_parser_config
414+
.ignore_invalid_headers_in_requests(enabled);
415+
self
416+
}
417+
405418
/// Set whether HTTP/1 connections should try to use vectored writes,
406419
/// or always flatten into a single buffer.
407420
///

0 commit comments

Comments
 (0)