feat(client): add option to allow misplaced spaces in HTTP/1 responses (#2506)

This commit is contained in:
Anthony Ramine
2021-04-20 23:17:48 +02:00
committed by GitHub
parent ed2fdb7b6a
commit 11345394d9
7 changed files with 117 additions and 5 deletions

View File

@@ -159,6 +159,7 @@ where
ParseContext {
cached_headers: parse_ctx.cached_headers,
req_method: parse_ctx.req_method,
h1_parser_config: parse_ctx.h1_parser_config.clone(),
#[cfg(feature = "ffi")]
preserve_header_case: parse_ctx.preserve_header_case,
h09_responses: parse_ctx.h09_responses,
@@ -183,7 +184,10 @@ where
}
}
pub(crate) fn poll_read_from_io(&mut self, cx: &mut task::Context<'_>) -> Poll<io::Result<usize>> {
pub(crate) fn poll_read_from_io(
&mut self,
cx: &mut task::Context<'_>,
) -> Poll<io::Result<usize>> {
self.read_blocked = false;
let next = self.read_buf_strategy.next();
if self.read_buf_remaining_mut() < next {
@@ -378,7 +382,7 @@ impl ReadStrategy {
*decrease_now = false;
}
}
},
}
#[cfg(feature = "client")]
ReadStrategy::Exact(_) => (),
}
@@ -639,6 +643,7 @@ mod tests {
let parse_ctx = ParseContext {
cached_headers: &mut None,
req_method: &mut None,
h1_parser_config: Default::default(),
#[cfg(feature = "ffi")]
preserve_header_case: false,
h09_responses: false,