Skip to content

Commit 503f6c3

Browse files
committed
http1 expose ignore_invalid_headers_in_requests opt
1 parent e981a91 commit 503f6c3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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)