]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Dump Object Lock Retain Date as ISO 8601 44697/head
authorDanny Abukalam <danny@softiron.com>
Sat, 10 Jul 2021 15:58:46 +0000 (11:58 -0400)
committerCory Snyder <csnyder@iland.com>
Thu, 20 Jan 2022 18:31:33 +0000 (13:31 -0500)
This matches the S3 API format, which uses 8601 for the
object lock retain until date.

Fixes: https://tracker.ceph.com/issues/51327
Signed-off-by: Danny Abukalam <danny@softiron.com>
(cherry picked from commit fc898da49910f90a51eec30e4199357a3e0c5f6f)

src/rgw/rgw_rest_s3.cc

index 2247c20dd2167a0524f60324d4afbb6a30afdb61..724c3d30d84b79842583fe47c273013757b52afc 100644 (file)
@@ -393,7 +393,8 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,
         try {
           decode(retention, iter->second);
           dump_header(s, "x-amz-object-lock-mode", retention.get_mode());
-          dump_time_header(s, "x-amz-object-lock-retain-until-date", retention.get_retain_until_date());
+          string date = ceph::to_iso_8601(retention.get_retain_until_date());
+          dump_header(s, "x-amz-object-lock-retain-until-date", date.c_str());
         } catch (buffer::error& err) {
           ldpp_dout(this, 0) << "ERROR: failed to decode RGWObjectRetention" << dendl;
         }