swift cli does not send content-length header to create container

Bug #951155 reported by Ken Pepple
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
python-swiftclient
Fix Released
Undecided
Sam Morrison

Bug Description

My configuration has swift-proxy behind nginx.

The problem occurs with respect to uploading to a container that doesn't exist or using the swift client 'post' command to create one:

  swift -A https://swift-um2.acme.com/auth/v1.0 -U james -K cubswins upload test12 nginx-conf.tar

OR

  swift -A https://swift-um2.acme.com/auth/v1.0 -U james -K cubswins post test12

both will generate a 411 error "content-length header not set error" in nginx and not pass the request on to swift-proxy.

I think swift cli is not compliant with RFC2616:

  For compatibility with HTTP/1.0 applications, HTTP/1.1 requests containing a message-body MUST include a valid Content-Length header field unless the server is known to be HTTP/1.1 compliant. If a request contains a message-body and a Content-Length is not given, the server SHOULD respond with 400 (bad request) if it cannot determine the length of the message, or with 411 (length required) if it wishes to insist on receiving a valid Content-Length. (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html)

Ken Pepple (ken-pepple)
Changed in swift:
assignee: nobody → Ken Pepple (ken-pepple)
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/5167

Changed in swift:
status: New → In Progress
Thierry Carrez (ttx)
tags: added: python-swiftclient
Thierry Carrez (ttx)
affects: swift → python-swiftclient
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-swiftclient (master)

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

Changed in python-swiftclient:
assignee: Ken Pepple (ken-pepple) → Sam Morrison (sorrison)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-swiftclient (master)

Reviewed: https://review.openstack.org/11385
Committed: http://github.com/openstack/python-swiftclient/commit/29c3af811c830d52871d63e592130f442716118c
Submitter: Jenkins
Branch: master

commit 29c3af811c830d52871d63e592130f442716118c
Author: Sam Morrison <email address hidden>
Date: Wed Aug 15 14:31:16 2012 +1000

    Ensure Content-Length header when PUT/POST a container

    Fixes bug #951155

    Change-Id: Ib1455ddb142137cc0946d50a66540eae6402f598

Changed in python-swiftclient:
status: In Progress → Fix Committed
Tom Fifield (fifieldt)
Changed in python-swiftclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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