From: Sylvain Munaut Date: Thu, 14 Feb 2013 13:48:16 +0000 (+0100) Subject: radosgw: Fix duplicate 'Content-Type' when using 'response-content-type' X-Git-Tag: v0.61~130 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b953aa4100eca5de2319b3c17c54bc2f6b03064;p=ceph.git radosgw: Fix duplicate 'Content-Type' when using 'response-content-type' Signed-off-by: Sylvain Munaut Reviewed-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 7a5e941b613b..add523a6e9ca 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -117,8 +117,9 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs, off_ if (response_attrs.count(aiter->second) > 0) // was already overridden by a response param continue; - if ((!content_type) && aiter->first.compare(RGW_ATTR_CONTENT_TYPE) == 0) { // special handling for content_type - content_type = iter->second.c_str(); + if (aiter->first.compare(RGW_ATTR_CONTENT_TYPE) == 0) { // special handling for content_type + if (!content_type) + content_type = iter->second.c_str(); continue; } response_attrs[aiter->second] = iter->second.c_str();