Bug #10986
closedRGW: wrong length is returned by RGWFormatter_Plain::get_len()
0%
Description
When the formatted content has non-zero length, RGWFormatter_Plain::get_len() method returns its size minus 1 byte. It leads to wrong behaviour when the method is used to generate "Content-Length" HTTP header. Please refer to: https://github.com/ceph/ceph/blob/master/src/rgw/rgw_formats.cc#L153.
The behaviour could be seen with following patch applied: https://github.com/ceph/ceph/commit/9357a669ead149f264370af32556786563e377f6.
1. RGW via FCGI frontend: curl -i http://localhost:8080/swift/v1/cont -X GET -H "X-Auth-Token: $token"
HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Mon, 02 Mar 2015 11:36:48 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 4
Connection: keep-alive
Accept-Ranges: bytesfile
2. Swift: curl -H "X-Auth-Token: $token" -X GET -i http://localhost:9090/v1/AUTH_test/cont
HTTP/1.1 200 OK
Content-Length: 5
X-Container-Object-Count: 1
Accept-Ranges: bytes
X-Timestamp: 1424789735.12920
X-Container-Bytes-Used: 0
Content-Type: text/plain; charset=utf-8
X-Trans-Id: txb860f447f6054d10878f4-0054f44a5d
Date: Mon, 02 Mar 2015 11:32:45 GMTfile
Updated by Dmytro Yurchenko about 9 years ago
- Assignee set to Radoslaw Zarzynski
Updated by Radoslaw Zarzynski about 9 years ago
Pull request: https://github.com/ceph/ceph/pull/3863.
Updated by Radoslaw Zarzynski about 9 years ago
- Status changed from New to Fix Under Review
Updated by Casey Bodley about 4 years ago
- Status changed from Fix Under Review to Resolved