Project

General

Profile

Actions

Bug #270

closed

Content-Type not returned / saved correctly

Added by Wido den Hollander almost 14 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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

Screenshot-bond0.pcap_-_Wireshark.png (135 KB) Screenshot-bond0.pcap_-_Wireshark.png Wido den Hollander, 07/11/2010 04:07 AM
return_content_length_header.patch (649 Bytes) return_content_length_header.patch Fix for returning the Content-Length Wido den Hollander, 07/14/2010 05:59 AM
Actions #1

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.

Actions #2

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.

Actions #3

Updated by Sage Weil almost 14 years ago

  • Assignee set to Greg Farnum
Actions #4

Updated by Greg Farnum almost 14 years ago

Done in commit:e6ec74fb3b8198feb427d33a9ef115e66589e494. The getxattrs function got broken a few months ago.

Actions #5

Updated by Greg Farnum almost 14 years ago

  • Status changed from New to Closed
Actions #6

Updated by Sage Weil about 13 years ago

  • Category set to radosgw
Actions #7

Updated by Sage Weil about 13 years ago

  • Project changed from 4 to Ceph
  • Category changed from radosgw to 22
Actions #8

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.

Actions

Also available in: Atom PDF