HttpResponse bug screws up chunked transfer-coding
|Reported by:||Owned by:||Adrian Holovaty|
|Severity:||Keywords:||http chunked transfer-encoding|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When an HttpResponse is created, the _container defaults to [""]. Later additions are appended, so you end up with ["", "Actual content here."]. Such a response fails when sent by CherryPy's wsgiserver.py in HTTP/1.1 mode, because the chunked transfer-coding implementation sends a last-chunk token for that first "" in _container.
The attached patch solves the problem by initializing _container to an empty list () when HttpRequest is constructed with content="".
This bug first surfaced in Aspen.