]> 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)
committerVicente Cheng <freeze.bilsted@gmail.com>
Thu, 31 Mar 2016 09:29:29 +0000 (17:29 +0800)
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>
(cherry picked from commit 471fa29e643fcfd5e1383fb987f99b5b21038ed7)

src/rgw/rgw_rest_s3.cc

index 0cc7793ac9ad0109fa7392b2b88b4a58c383f154..72e1fe135dde09560e7e074a31968379fe3cf26e 100644 (file)
@@ -167,10 +167,14 @@ done:
     s->cio->print("%s: %s\r\n", riter->first.c_str(), riter->second.c_str());
   }
 
-  if (!content_type)
-    content_type = "binary/octet-stream";
+  if (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()) {
     s->cio->write(metadata_bl.c_str(), metadata_bl.length());