From 11a9fc2475cfe0815665cd56b4ae0c784986e6c4 Mon Sep 17 00:00:00 2001 From: Tianshan Qu Date: Tue, 19 Jun 2018 11:57:45 +0800 Subject: [PATCH] rgw: fix copy response header etag format not correct response header etag should wrapped with quotation marks fixes: http://tracker.ceph.com/issues/24563 Signed-off-by: Tianshan Qu --- src/rgw/rgw_rest_s3.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index b60bbeb58e108..b7ed39f315e13 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1436,7 +1436,7 @@ void RGWPutObj_ObjStore_S3::send_response() if (strftime(buf, sizeof(buf), "%Y-%m-%dT%T.000Z", &tmp) > 0) { s->formatter->dump_string("LastModified", buf); } - s->formatter->dump_string("ETag", etag); + dump_etag(s, etag); s->formatter->close_section(); rgw_flush_formatter_and_reset(s, s->formatter); return; @@ -2192,9 +2192,7 @@ void RGWCopyObj_ObjStore_S3::send_response() if (op_ret == 0) { dump_time(s, "LastModified", &mtime); - if (! etag.empty()) { - s->formatter->dump_string("ETag", std::move(etag)); - } + dump_etag(s, etag); s->formatter->close_section(); rgw_flush_formatter_and_reset(s, s->formatter); } -- 2.39.5