News for hackers. Stuff that matters.
Re:Ask HN | http compliance if post with content-length:0 by dalke on Wednesday July 10, 2013 @11:32AM (#6020388)
What does it matter?

What you should do is have the error messages be the same for detecting a length 0 submission and of attempting to parse the empty string as JSON.

You can think of the check for length==0 and length==1 as a sort of optimization (no JSON document can be 1 byte long), rather than a corner case.

There are no comments on this comment yet.