[Web-SIG] Chunked Tranfer encoding on request content.

Sidnei da Silva sidnei at enfoldsystems.com
Mon Mar 5 01:55:04 CET 2007

I'm not quite aware of the 100 Continue semantics, but I know that
applications which request Transfer-Encoding: chunked should *not*
expect a Content-Length response header, nor should the WSGI thingie
doing the 'chunking' need to know it in advance.

'chunked' is actually very simple. Simplifying it a lot, it basically
needs to output '%x\r\n%s\r\n' % (len(chunk), chunk) for every chunk
of data except the last which should be '0\r\n\r\n'. The only trick
here is ensuring that no chunk of length '0' is written except the

What might be happening is that CherryPy is outputting the whole
response body as a single chunk, and relying on the 'Content-Length'
header, which would be silly, I hope that's not what's happening
though I haven't looked.

Sidnei da Silva
Enfold Systems                http://enfoldsystems.com
Fax +1 832 201 8856     Office +1 713 942 2377 Ext 214

More information about the Web-SIG mailing list