[Web-SIG] PEP 444 (aka Web3)

Armin Ronacher armin.ronacher at active-4.com
Fri Sep 17 20:06:13 CEST 2010


Hi,

On 9/17/10 7:43 PM, Ian Bicking wrote:
> I'm also not sure what motivated this particular change, but I don't
> have any opinion one way or the other.
Motivation is that WSGI wants servers to do something like this:

    if len(iterable) == 1 and content_length_header_missing:
        headers.append(('Content-Length', str(len(iterable[0])))

However not everybody was doing that and some applications were setting 
a content length header or not.  If a content length header was not set 
some middlewares that changed content worked properly even though they 
did not check the header.  The idea is that with web3 every tool in the 
chain is supposed to look for that header and update it appropriately.

Even the piglatin middleware from the PEP 333 did not check the content 
length if I remember correctly.


Regards,
Armin


More information about the Web-SIG mailing list