]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Dump Object Lock Retain Date as ISO 8601 43656/head
authorPreben Uhrskov Berg <poulpreben@users.noreply.github.com>
Mon, 25 Oct 2021 20:18:03 +0000 (22:18 +0200)
committerPreben Berg <pb@cloudio.dk>
Mon, 25 Oct 2021 20:36:44 +0000 (22:36 +0200)
This matches the S3 API format, which uses 8601 for the
object lock retain until date.

Backport of: https://tracker.ceph.com/issues/51327
Fixes: https://tracker.ceph.com/issues/51774
Signed-off-by: Preben Berg <pb@cloudio.dk>
src/rgw/rgw_rest_s3.cc

index 52071cf09a5938deb8f5c4e0faacf2fd024a4998..cb026714de397401cf457e766747251360fcb144 100644 (file)
@@ -386,7 +386,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;
         }