From: liuchang0812 Date: Mon, 27 Mar 2017 05:08:12 +0000 (+0800) Subject: rgw/lifecycle: do not send lifecycle rules when GetLifeCycle failed X-Git-Tag: v11.2.1~72^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14528%2Fhead;p=ceph.git rgw/lifecycle: do not send lifecycle rules when GetLifeCycle failed Now, RGW will send two HTTP responses when GetLifeCycle failed. The first one is Error Respnse like 404, and the second is lifecycle rules. It will breaks s3 sdk and s3 utilities. Fixes: http://tracker.ceph.com/issues/19363 Signed-off-by: liuchang0812 (cherry picked from commit c3c0c828da5a64ca896475c1b0c369fde1bbd76a) --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 63b100e19a6..85d78e527ae 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2370,6 +2370,9 @@ void RGWGetLC_ObjStore_S3::send_response() end_header(s, this, "application/xml"); dump_start(s); + if (op_ret < 0) + return; + config.dump_xml(s->formatter); rgw_flush_formatter_and_reset(s, s->formatter); }