From: Radoslaw Zarzynski Date: Tue, 23 Jun 2015 09:54:09 +0000 (+0200) Subject: rgw: enforce Content-Type in Swift responses. X-Git-Tag: v0.80.11~5^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c9226afd7b9e54a8998bf88dfbd6753b262fdf9d;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 (cherry picked from commit 106aeba206736d4080326f9bc191876bed63370b) --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 4142809f852..604313c6a30 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -436,6 +436,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()){