From: Wido den Hollander Date: Mon, 21 Mar 2016 15:50:49 +0000 (+0100) Subject: rgw: Do not send a Content-Type on a '304 Not Modified' response X-Git-Tag: v10.1.1~118^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=471fa29e643fcfd5e1383fb987f99b5b21038ed7;p=ceph.git rgw: Do not send a Content-Type on a '304 Not Modified' response 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 --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index a31b95b0b63e..f24cbae5bdc0 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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());