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: v0.94.8~30^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e53751d0e52f6fb611d9bd81fe2115cd7ce533b3;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 (cherry picked from commit 471fa29e643fcfd5e1383fb987f99b5b21038ed7) --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 0cc7793ac9a..72e1fe135dd 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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());