]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: enforce Content-Type in Swift responses.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Tue, 23 Jun 2015 09:54:09 +0000 (11:54 +0200)
committerNathan Cutler <ncutler@suse.com>
Mon, 5 Oct 2015 14:00:59 +0000 (16:00 +0200)
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 <rzarzynski@mirantis.com>
(cherry picked from commit 106aeba206736d4080326f9bc191876bed63370b)

src/rgw/rgw_rest.cc

index 4142809f8525f43a6d1afefc0235cf1b2fac63b6..604313c6a3078da5a8121e92ddf99b72ebb9c8f8 100644 (file)
@@ -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()){