Code

Opened 7 years ago

Closed 7 years ago

#3619 closed (invalid)

HttpResponse bug screws up chunked transfer-coding

Reported by: chad@… Owned by: adrian
Component: Core (Other) Version: master
Severity: Keywords: http chunked transfer-encoding
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

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.

Attachments (1)

chunked.patch (709 bytes) - added by chad@… 7 years ago.
patch to make HttpResponse play nicer with HTTP/1.1

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by chad@…

patch to make HttpResponse play nicer with HTTP/1.1

comment:1 Changed 7 years ago by chad@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The bug lies more properly with CherryPyWSGIServer: it should only write chunks that are non-empty. And in fact, this change has been made in CherryPy 3.0.1.

Sorry to bother you!

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.