seanmonstar / httparse

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

Allow providing a list of expected headers #79

Closed ctron closed 4 years ago

ctron commented 4 years ago

When parsing a response, the number of headers is limited.

However, if an application knows upfront which headers it cares about, all other headers could be ignored, and simply skipped from returning.

It would be great if the user could provide a list of "expected" (or "allowed") headers. And only those headers would get recorded for the result.

seanmonstar commented 4 years ago

This could be an interesting thing to do! However, I think it's out of scope of this library, as it seems rather niche. Therefore, I'm going to close up here.