httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roy T. Fielding <field...@gbiv.com>
Subject Re: POST without Content-Length
Date Sat, 07 Aug 2004 22:36:33 GMT
>> CGI would happen after mod_deflate.  If mod_deflate changes the 
>> request
>> body without also (un)setting content-length, then it is broken.
>
> Huh? Input filters are pulled, so they run *after* the handler has been
> started. And - CONTENT_LENGTH (if any - It's unset for chunked as 
> well) still
> reflects the Content-Length sent by the client. So the current 
> behaviour is
> correct in all cases.

No, it is broken in all cases.  CGI scripts cannot handle chunked input
and they cannot handle bodies without content-length -- that is how the
interface was designed.  You would have to define a CGI+ interface to
get some other behavior.

> A CGI script therefore should never trust Content-Length, but just read
> stdin until it meets an EOF.

We cannot redefine CGI.  It is a legacy crap interface.  Input filters
either have to be disabled for CGI or replaced with a buffering system
that takes HTTP/1.1 in and supplies CGI with the correct metadata and 
body.

....Roy


Mime
View raw message