]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix generic obj attrs to http headers
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 5 Jan 2019 18:24:34 +0000 (10:24 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Sun, 6 Jan 2019 21:14:13 +0000 (13:14 -0800)
use bl.to_str() instead of bl.c_str() to avoid encoding of the null
termination.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest_s3.cc

index 2f87e9e64496dcef6c8824eadc505b763c3d489d..2f4c532820390837a773994ae21853934c1657a0 100644 (file)
@@ -290,7 +290,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
       if (aiter != rgw_to_http_attrs.end()) {
         if (response_attrs.count(aiter->second) == 0) {
           /* Was not already overridden by a response param. */
-          response_attrs[aiter->second] = iter->second.c_str();
+          response_attrs[aiter->second] = iter->second.to_str();
         }
       } else if (iter->first.compare(RGW_ATTR_CONTENT_TYPE) == 0) {
         /* Special handling for content_type. */