The documentation seems to be a little bit controversial
http://docs.openstack.org/api/openstack-object-storage/1.0/content/POST_updateObjectMeta__v1__account___container___object__storage_object_services.html
It says: Content-Length If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body.
But at the same time both examples do not return Content-Length: 0 on success
curl -i $publicURL/marktwain/goodbye -X POST -H "X-Auth-Token: $token" -H "X-Object-Meta-Book: GoodbyeColumbus"
HTTP/1.1 202 Accepted
Content-Length: 76
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txb5fb5c91ba1f4f37bb648-0052d84b3f
Date: Thu, 16 Jan 2014 21:12:31 GMT
<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>
curl -i $publicURL/marktwain/goodbye -X POST -H "X-Auth-Token: $token" -H "X-Object-Meta-Book: GoodbyeOldFriend"
HTTP/1.1 202 Accepted
Content-Length: 76
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx5ec7ab81cdb34ced887c8-0052d84ca4
Date: Thu, 16 Jan 2014 21:18:28 GMT
<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>
One thing is for sure, that Content-Length has to be present.
When I use built-in civetweb frontend:
$ curl -I "http://localhost:8000/swift/v1/cont1/file1" -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $token"
HTTP/1.1 202 Accepted
Content-type: text/plain; charset=utf-8
Content-Length: 0
$ curl -I "http://localhost:8000/swift/v1/cont1/non-existent-file" -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $token"
HTTP/1.1 404 Not Found
Content-Length: 9
Accept-Ranges: bytes
Content-type: text/plain; charset=utf-8
But when I use fcgi frontend behind nginx:
$ curl -I "http://localhost:8080/swift/v1/cont1/file1" -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $token"
HTTP/1.1 202 Accepted
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 04 Feb 2015 13:46:59 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
$ curl -I "http://localhost:8080/swift/v1/cont1/non-existent-file" -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $token"
HTTP/1.1 404 Not Found
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 04 Feb 2015 13:48:54 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 9
Connection: keep-alive
Accept-Ranges: bytes
It seems like nginx thinks "Content-Length: 0" is useless and threw it away while preserving content-length greater than 0.
Please, check if it is an issue caused by Apache.