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 <wido@42on.com>
This commit is contained in:
Wido den Hollander 2016-03-21 16:50:49 +01:00
parent 35479a92e5
commit 471fa29e64

View 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());