From: Radoslaw Zarzynski Date: Tue, 23 Jun 2015 09:54:09 +0000 (+0200) Subject: rgw: enforce Content-Type in Swift responses. X-Git-Tag: v9.0.2~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5089%2Fhead;p=ceph.git rgw: enforce Content-Type in Swift responses. Swift sends Content-Type HTTP header even if the response doesn't contain body. We have this behaviour implemented until applying some changes in end_header() function. Unfortunately, lack of Content-Type causes early exits in many Tempest's tests for Swift API verification. Fixes: #12157 Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 8dbe138f29f4..914eb5b65a5f 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -503,6 +503,10 @@ void end_header(struct req_state *s, RGWOp *op, const char *content_type, const dump_access_control(s, op); } + if (s->prot_flags & RGW_REST_SWIFT) { + force_content_type = true; + } + /* do not send content type if content length is zero and the content type was not set by the user */ if (force_content_type || (!content_type && s->formatter->get_len() != 0) || s->err.is_err()){