Bug #270
closedContent-Type not returned / saved correctly
0%
Description
When setting the contentType when uploading, the gateway does not return this correctly.
Putting a file:
wido@wido-laptop:~$ s3 -u put blog/tesla_model_s.jpg filename=Ubuntu\ One/Documenten/Tesla/naias-2010-model-s-01.jpg contentType=image/jpeg 134710 bytes remaining (10% complete) ... 118326 bytes remaining (21% complete) ... 101942 bytes remaining (32% complete) ... 85558 bytes remaining (43% complete) ... 69174 bytes remaining (54% complete) ... 52790 bytes remaining (65% complete) ... 36406 bytes remaining (75% complete) ... 20022 bytes remaining (86% complete) ... 3638 bytes remaining (97% complete) ... wido@wido-laptop:~$
With wireshark i verified if the client is setting the right contentType, it is (see attachment).
Then when GET'ing the file, the content-type text/plain is returned.
Going through "rgw_rest.cc" there seems to be support for Content-Type.
Files
Updated by Wido den Hollander almost 14 years ago
I've spent some time searching for the cause of this bug.
It seems the issue is in "rgw_rest.cc" in method "RGWGetObj_REST::send_response()"
I found a second bug, the Content-Length is not returned either, a patch for that is attached.
Now, it seems that not only the Content-Type goes wrong, but same goes for the ETag, which isn't returned either when doing a GET request.
When listing all the objects in a bucket (with public-acl) goes fine, the ETag is returned.
map<string, bufferlist>::iterator iter = attrs.find(RGW_ATTR_ETAG); if (iter != attrs.end()) { bufferlist& bl = iter->second; if (bl.length()) { char *etag = bl.c_str(); dump_etag(s, etag); } }
Here the ETag attr doesn't seem to be found, when that does, neither the ETag nor Content-Type is returned.
I haven't been able to find the cause for this.
Updated by Wido den Hollander almost 14 years ago
Searching further i found that it seems to go wrong in "rgw_rados.cc"
Line 475:
if (attrs) { r = rados->getxattrs(pool, oid, *attrs); for (iter = attrs->begin(); iter != attrs->end(); ++iter) { cerr << "xattr: " << iter->first << std::endl; } if (r < 0) return r; }
rados->getattrs doesn't seem to return anything, since xattr: is never printed in the error-log from Apache.
Tried adding a few debug messages, failed too.
Updated by Greg Farnum almost 14 years ago
Done in commit:e6ec74fb3b8198feb427d33a9ef115e66589e494. The getxattrs function got broken a few months ago.
Updated by Sage Weil about 13 years ago
- Project changed from 4 to Ceph
- Category changed from radosgw to 22
Updated by John Spray over 6 years ago
- Project changed from Ceph to rgw
- Category deleted (
22)
Bulk reassign of radosgw category to RGW project.