Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ask HN | http compliance if post with content-length:0.
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.
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.