]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add default Server response header 50510/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 13 Mar 2023 21:21:47 +0000 (17:21 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 13 Mar 2023 21:27:25 +0000 (17:27 -0400)
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 <cbodley@redhat.com>
src/rgw/rgw_rest.cc

index d37afff526a4b30b0ad5f7a35a46e6b5a26df929..777a0bf5569e9a65c85d24d8dc57f59a163376c2 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <boost/algorithm/string.hpp>
 #include <boost/tokenizer.hpp>
+#include "ceph_ver.h"
 #include "common/Formatter.h"
 #include "common/HTMLFormatter.h"
 #include "common/utf8.h"
@@ -615,7 +616,13 @@ void end_header(req_state* s, RGWOp* op, const char *content_type,
   if (content_type) {
     dump_header(s, "Content-Type", content_type);
   }
-  dump_header_if_nonempty(s, "Server", g_conf()->rgw_service_provider_name);
+
+  std::string srv = g_conf().get_val<std::string>("rgw_service_provider_name");
+  if (!srv.empty()) {
+    dump_header(s, "Server", srv);
+  } else {
+    dump_header(s, "Server", "Ceph Object Gateway (" CEPH_RELEASE_NAME ")");
+  }
 
   try {
     RESTFUL_IO(s)->complete_header();