Relax http response parsing?
- Dominant language
- C++
- Stars
- 4.8k
- Forks
- 694
- Avg merge
- 12h 48m
- Merged PRs (30d)
- 1
Description
I'm currently trying to replace a libsoup based http client implementation with boost beast.
However, beast's http response parser is (deliberately) very strict when it comes to RFC compliance.
For example, (in contrast to libsoup) it only accepts:
`status-line = HTTP-version SP status-code SP reason-phrase CRLF`
Unfortunately, various "real world" servers don't strictly play by the rules and e.g. return status lines that are only terminated by a `LF`. While it would theoretically be the best to fix these servers, in practice this is often not really possible.
I realize that this (or a similar) topic has already been discussed in the past:
- https://github.com/boostorg/beast/issues/1761
- https://github.com/boostorg/beast/issues/1138
- https://github.com/boostorg/beast/issues/2344
And of course, one could always just patch the parser code as needed. Nevertheless, I'd like to know:
- Are there any plans to provide a more relaxed way of parsing? E.g. maybe via some opt-in `basic_parser::relaxed()` function? Or would something like this be strictly against the spirit of the library?
- If adjusting parsing is not an option, what would be the best/easiest way to preprocess/filter incoming data first? To me, the approach outlined in the `icy_stream.hpp` example seems overly complicated but so far I haven't found a simpler/more obvious approach.
Contributor guide
Assessment
This issue has not been assessed yet.