missing content_length header in response

Bug #1066523 reported by David Hadas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Invalid
Undecided
David Hadas

Bug Description

When listing an empty container or account the content_length is missing from the response.

The problem starts with the swob Response initiated by account and container server with a body equal to None instead of an empty string. As a result, swob fails to set the content_length to zero.
The problem was detected during a GET but may exist with other requests
The offered solution includes:

1. Adding an assert to the unit test - asserting content_length of zero during the unit test that lists an empty container
2. Adding an assert to the unit test - asserting content_length of zero during the unit test that lists an empty account
3. Testing for to if not body - than setting body to an empty string.

This bug was detected as part of the https://blueprints.launchpad.net/swift/+spec/wsgi-application-interface blueprint.

Changed in swift:
assignee: nobody → David Hadas (david-hadas)
Changed in swift:
status: New → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/14448

Revision history for this message
Constantine Peresypkin (constantine-q) wrote :

Hmm...according to rfc2616 you're just trying to introduce a bug...

"The presence of a message-body in a request is signaled by the
   inclusion of a Content-Length or Transfer-Encoding header field in
   the request's message-headers. A message-body MUST NOT be included in
   a request if the specification of the request method (section 5.1.1)
   does not allow sending an entity-body in requests."

Response 204 MUST NOT include a body, therefore body presence MUST NOT be signaled by Content-Length header.

Revision history for this message
David Hadas (david-hadas) wrote :

Constantine seem to be correct that the standard does not mandate sending a content-length during a 204 response.
At this stage I suggest to abandon the change.

Changed in swift:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.