]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: include RequestId as part of the Error response 5866/head
authorJavier M. Mellid <jmunhoz@igalia.com>
Wed, 9 Sep 2015 13:56:04 +0000 (15:56 +0200)
committerJavier M. Mellid <jmunhoz@igalia.com>
Thu, 10 Sep 2015 08:58:02 +0000 (10:58 +0200)
The RGW error responses must contain a RequestId to be compliant with
the Amazon S3 errors. This RequestId is the ID of the request associated
with the error.

Fixes: #13020
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
src/rgw/rgw_rest.cc

index b7f51970d09cfcd558c5ca381a758b70277550b7..e2b1568247c31227412d485b55a3c4731b9abf87 100644 (file)
@@ -553,6 +553,8 @@ void end_header(struct req_state *s, RGWOp *op, const char *content_type, const
       s->formatter->dump_string("Code", s->err.s3_code);
     if (!s->err.message.empty())
       s->formatter->dump_string("Message", s->err.message);
+    if (!s->trans_id.empty())
+      s->formatter->dump_string("RequestId", s->trans_id);
     s->formatter->close_section();
     dump_content_length(s, s->formatter->get_len());
   } else {