What was your solution to this? Parse the things the library didn't?
In my view it's a very bad design for an http library, although it would have been a lot less frustrating if it had at least provided an escape hatch.
Which I agree, is a poor design choice. A type modeling an HTTP request should model the RFC definition as closely as possible.
I couldn't disagree more. A type modeling an HTTP request should model HTTP requests. Not some theoretical description of an HTTP request.
But in this universe, no.
They're created by something, but that something has more to do with a million blog posts and hallway conversations than it does with the formal RFC process. Certainly for most specifications of this kind, the working code came first and the specification was based largely on discovering what existing implementations did. If what the specification says is different from what HTTP clients send and HTTP servers understand, so much the worse for the specification.
I typically design code around things like this with a sum type like:
data Header = KnownHeader1 | KnownHeader2 | UnknownHeader String String
Then I typically don't offer any extra support or extended functionality for the cases where the type is `UnknownHeader`.
However, I have had to deal occasionally with http libraries that tried to parse everything and would not give you access to anything that they could not parse. This was incredibly frustrating for corner cases that the library authors hadn't considered.
If you are the one who is going to take action on the data, parse don't validate is the correct approach. If you are writing a library that deals with data that it doesn't fully understand, and you're handing that data to someone else to take action with, then it may not always be the right approach.