seanmonstar / httparse

A push parser for the HTTP 1.x protocol in Rust.
https://docs.rs/httparse
Apache License 2.0
590 stars 115 forks source link

Ignoring invalid headers for requests #145

Closed grnmeira closed 1 year ago

grnmeira commented 1 year ago

The idea for this PR came up from this discussion in the hyper repo.

This PR tries to make a request version of the ParserConfig::ignore_invalid_headers_in_responses configuration, introduced as ParserConfig::ignore_invalid_headers_in_requests, so that we can also ignore invalid headers in requests.

In order to achieve that avoiding breaking backwards compatibility, it splits the ParserConfig struct used for parse_headers_iter_uninit into ParserConfig and HeaderParserConfig.

Happy to reassess the tests or the approach.

grnmeira commented 1 year ago

@seanmonstar any chances we could get this in? Happy to make any changes if needed too.