Skip to content

Commit 7a1e4e6

Browse files
committed
rgw: add default Server response header
if a specific rgw_service_provider_name is not configured, add a default Server response header that includes the ceph release name: Server: Ceph Object Gateway (reef) Signed-off-by: Casey Bodley <[email protected]>
1 parent f46ff8f commit 7a1e4e6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/rgw/rgw_rest.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <boost/algorithm/string.hpp>
99
#include <boost/tokenizer.hpp>
10+
#include "ceph_ver.h"
1011
#include "common/Formatter.h"
1112
#include "common/HTMLFormatter.h"
1213
#include "common/utf8.h"
@@ -615,7 +616,13 @@ void end_header(req_state* s, RGWOp* op, const char *content_type,
615616
if (content_type) {
616617
dump_header(s, "Content-Type", content_type);
617618
}
618-
dump_header_if_nonempty(s, "Server", g_conf()->rgw_service_provider_name);
619+
620+
std::string srv = g_conf().get_val<std::string>("rgw_service_provider_name");
621+
if (!srv.empty()) {
622+
dump_header(s, "Server", srv);
623+
} else {
624+
dump_header(s, "Server", "Ceph Object Gateway (" CEPH_RELEASE_NAME ")");
625+
}
619626

620627
try {
621628
RESTFUL_IO(s)->complete_header();

0 commit comments

Comments
 (0)