News for hackers. Stuff that matters.
Re:Show HN: Micro HTTP server in 22 lines of C by darnir on Saturday July 31, 2021 @11:44AM (#28019127)
HTTP/1.x is anything but simple. They were under defined and overly complex in many ways. The original RFC was so complex that when reworked, they split it into 6 documents.

I've worked heavily on some HTTP implementations and its ridiculously hard to get them right.

Not to mention, this "server" only responds to a simple well formed GET request. Without handling about 90% of what the HTTP specifications talk about. Its a nice project, but it doesn't speak to the simplicity of HTTP

Re:Show HN: Micro HTTP server in 22 lines of C by kevinoid on Saturday July 31, 2021 @01:39PM (#28020133)
I agree. As with many things, it's only simple as long as you ignore the complexities. As they say, the devil's in the details.

> this "server" only responds to a simple well formed GET request.

And not even that. The Request-URI in a Simple-Request line (inherited from HTTP/0.9) may contain escape characters. (e.g. `GET /my%20file.txt` to get `my file.txt`) HTTP/1.0 states "The origin server must decode the Request-URI in order to properly interpret the request."[1] This server does not.

Which is not to say that this server isn't interesting. Just that it's not a demonstration of how easy HTTP/1 is to parse.

[1]: https://www.w3.org/Protocols/HTTP/1.0/spec.html#Request-URI