Re: Termination of POST body

Roy Fielding (fielding@beach.w3.org)
Tue, 26 Sep 1995 17:31:49 -0400


>Paul Phillips writes:
>> Netscape/X and Mosaic/X terminate POST bodies with an extra \r\n. My
>> server has been reading all data available on the socket, which means
>> that the number of bytes sent to a CGI's stdin is two greater than the
>> supplied content length.
>>
>> [...]
>>
>> Or, do all clients in normal use supply content-length, and this is a
>> non-issue?

The reason they are doing it is because they are performing ass-backwards
tricks in order to compensate for broken CGI scripts that foolishly
use line-buffered input and would otherwise never receive the last line.

>We've only run across one instance where this caused problems, with a
>CGI that wasn't paying attention to content-length. Are there any
>reasons (other than strict compatibility) we should change it?

No. In fact, if you do what Netscape/Mosaic does, you cannot use
persistent connections. Trying to fix script bugs by breaking the
interface protocol is just plain stupid.

....Roy T. Fielding Department of ICS, University of California, Irvine USA
Visiting Scholar, MIT/LCS + World-Wide Web Consortium
(fielding@w3.org) (fielding@ics.uci.edu)