Hacker News new | ask | show | jobs
by Jaxan 2307 days ago
I feel like this bug should be solved by using a proper parsing, instead of greedily looking for a field...
1 comments

Headers are just text mixed with body and hard to figure out where they stop
Headers stop when you have 2 line endings consecutively[1], I don't see why it's hard.

[1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4....

Easy. They stop after \r\n\r\n.

There is no other RFC compliant way to end headers.