|
|
|
|
|
by kybernetikos
1206 days ago
|
|
The library didn't allow you to see the things (e.g. particular headers or options for those headers) that it didn't know to parse. Ultimately we had to migrate to a different library that didn't restrict us to just what the library knew. The decision not to let us even see things that the library didn't know about is particularly egregious where best practices are changing over time. 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. |
|
I typically design code around things like this with a sum type like:
Then I typically don't offer any extra support or extended functionality for the cases where the type is `UnknownHeader`.