]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Do not send a Content-Type on a '304 Not Modified' response
authorWido den Hollander <wido@42on.com>
Mon, 21 Mar 2016 15:50:49 +0000 (16:50 +0100)
committerWido den Hollander <wido@42on.com>
Tue, 22 Mar 2016 10:04:09 +0000 (11:04 +0100)
When we say the Content has not changed we should not respond
with a content type which defaults to binary/octet stream.

Fixes: #15119
Signed-off-by: Wido den Hollander <wido@42on.com>
src/rgw/rgw_rest_s3.cc

index a31b95b0b63e5671f0593b3fee864a5addde05f8..f24cbae5bdc004fccd448b4c01b8403a65f72456 100644 (file)
@@ -257,10 +257,14 @@ done:
                        riter->second.c_str());
   }
 
-  if (!content_type)
-    content_type = "binary/octet-stream";
+  if (op_ret == ERR_NOT_MODIFIED) {
+      end_header(s, this);
+  } else {
+      if (!content_type)
+          content_type = "binary/octet-stream";
 
-  end_header(s, this, content_type);
+      end_header(s, this, content_type);
+  }
 
   if (metadata_bl.length()) {
     STREAM_IO(s)->write(metadata_bl.c_str(), metadata_bl.length());