Bug #11088
closedRGW Swift API: wrong handling of empty metadata on Swift container
0%
Description
Ceph RADOS Gateway allows to set empty container metadata items if they are currently not present.
$ curl -i http://localhost:8080/swift/v1/cont -X POST -H "X-Auth-Token: $token" -H "X-Container-Meta-Test;"
HTTP/1.1 204 No Content
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 10 Mar 2015 17:52:31 GMT
Content-Type: text/plain; charset=utf-8
Connection: keep-alive
$ curl -i http://localhost:8080/swift/v1/cont -X HEAD -H "X-Auth-Token: $token"
HTTP/1.1 204 No Content
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 10 Mar 2015 17:52:39 GMT
Content-Type: text/plain; charset=utf-8
Connection: keep-alive
X-Container-Object-Count: 3
X-Container-Bytes-Used: 0
X-Container-Bytes-Used-Actual: 0
X-Storage-Policy: default-placement
X-Container-Meta-test:
Swift filters out such items:
$ curl -i http://localhost:9090/v1/AUTH_test/cont -X POST -H "X-Auth-Token: $token" -H "X-Container-Meta-Test;"
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txe2a69d98c60f45889bd84-0054ff2f14
Date: Tue, 10 Mar 2015 17:51:16 GMT
$ curl -i http://localhost:9090/v1/AUTH_test/cont -X HEAD -H "X-Auth-Token: $token"
HTTP/1.1 204 No Content
Content-Length: 0
X-Container-Object-Count: 2
Accept-Ranges: bytes
X-Timestamp: 1424789735.12920
X-Container-Bytes-Used: 0
Content-Type: text/plain; charset=utf-8
X-Trans-Id: tx32a97f9099984fc58d827-0054ff2f1b
Date: Tue, 10 Mar 2015 17:51:23 GMT