]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "rgw/beast: add extra_response_headers for Server name"
authorCasey Bodley <cbodley@redhat.com>
Mon, 13 Mar 2023 21:18:39 +0000 (17:18 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 13 Mar 2023 21:18:39 +0000 (17:18 -0400)
This reverts commit ffeacc095963436588da749f34c5890ca8c74aa4.

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_asio_client.cc
src/rgw/rgw_asio_client.h
src/rgw/rgw_asio_frontend.cc

index cee16d06a44a8560cc88c5b30d659b17b381a216..a0ec0bf5c0683a33ab0e66be52be37deafbec83a 100644 (file)
@@ -14,12 +14,10 @@ using namespace rgw::asio;
 
 ClientIO::ClientIO(parser_type& parser, bool is_ssl,
                    const endpoint_type& local_endpoint,
-                   const endpoint_type& remote_endpoint,
-                   std::string_view extra_response_headers)
+                   const endpoint_type& remote_endpoint)
   : parser(parser), is_ssl(is_ssl),
     local_endpoint(local_endpoint),
     remote_endpoint(remote_endpoint),
-    extra_response_headers(extra_response_headers),
     txbuf(*this)
 {
 }
@@ -151,11 +149,6 @@ size_t ClientIO::complete_header()
     sent += txbuf.sputn(timestr, strlen(timestr));
   }
 
-  if (extra_response_headers.size()) {
-    sent += txbuf.sputn(extra_response_headers.data(),
-                        extra_response_headers.size());
-  }
-
   if (parser.keep_alive()) {
     constexpr char CONN_KEEP_ALIVE[] = "Connection: Keep-Alive\r\n";
     sent += txbuf.sputn(CONN_KEEP_ALIVE, sizeof(CONN_KEEP_ALIVE) - 1);
index b7f0e003a2e1e2be152af73773e4d5657728ef40..e2ab943dd57f7c1c0caf75ea92bc36446b2d394a 100644 (file)
@@ -25,7 +25,6 @@ class ClientIO : public io::RestfulClient,
   using endpoint_type = boost::asio::ip::tcp::endpoint;
   endpoint_type local_endpoint;
   endpoint_type remote_endpoint;
-  std::string_view extra_response_headers;
 
   RGWEnv env;
 
@@ -35,8 +34,7 @@ class ClientIO : public io::RestfulClient,
  public:
   ClientIO(parser_type& parser, bool is_ssl,
            const endpoint_type& local_endpoint,
-           const endpoint_type& remote_endpoint,
-           std::string_view extra_response_headers);
+           const endpoint_type& remote_endpoint);
   ~ClientIO() override;
 
   int init_env(CephContext *cct) override;
index fa05102882f3d8aa5c15ea208822494d01b1d0d4..633a2963300f60b2e10c809a185daa2bc6f00a85 100644 (file)
@@ -16,7 +16,6 @@
 #include "common/async/shared_mutex.h"
 #include "common/errno.h"
 #include "common/strtol.h"
-#include "ceph_ver.h"
 
 #include "rgw_asio_client.h"
 #include "rgw_asio_frontend.h"
@@ -79,10 +78,8 @@ class StreamIO : public rgw::asio::ClientIO {
            rgw::asio::parser_type& parser, yield_context yield,
            parse_buffer& buffer, bool is_ssl,
            const tcp::endpoint& local_endpoint,
-           const tcp::endpoint& remote_endpoint,
-           std::string_view extra_response_headers)
-      : ClientIO(parser, is_ssl, local_endpoint, remote_endpoint,
-                 extra_response_headers),
+           const tcp::endpoint& remote_endpoint)
+      : ClientIO(parser, is_ssl, local_endpoint, remote_endpoint),
         cct(cct), stream(stream), timeout(timeout), yield(yield),
         buffer(buffer)
   {}
@@ -196,7 +193,6 @@ void handle_connection(boost::asio::io_context& context,
                        SharedMutex& pause_mutex,
                        rgw::dmclock::Scheduler *scheduler,
                        const std::string& uri_prefix,
-                       std::string_view extra_response_headers,
                        boost::system::error_code& ec,
                        yield_context yield)
 {
@@ -269,8 +265,7 @@ void handle_connection(boost::asio::io_context& context,
       }
 
       StreamIO real_client{cct, stream, timeout, parser, yield, buffer,
-                           is_ssl, local_endpoint, remote_endpoint,
-                           extra_response_headers};
+                           is_ssl, local_endpoint, remote_endpoint};
 
       auto real_client_io = rgw::io::add_reordering(
                               rgw::io::add_buffering(cct,
@@ -442,8 +437,6 @@ class AsioFrontend {
   std::unique_ptr<dmc::ClientConfig> client_config;
   void accept(Listener& listener, boost::system::error_code ec);
 
-  std::string extra_response_headers;
-
  public:
   AsioFrontend(RGWProcessEnv& env, RGWFrontendConfig* conf,
               dmc::SchedulerCtx& sched_ctx)
@@ -565,9 +558,6 @@ int AsioFrontend::init()
   boost::system::error_code ec;
   auto& config = conf->get_config_map();
 
-  // format the Server response header
-  extra_response_headers = "Server: Ceph Object Gateway (" CEPH_RELEASE_NAME ")\r\n";
-
   if (auto i = config.find("prefix"); i != config.end()) {
     uri_prefix = i->second;
   }
@@ -1045,7 +1035,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec)
         conn->buffer.consume(bytes);
         handle_connection(context, env, stream, timeout, header_limit,
                           conn->buffer, true, pause_mutex, scheduler.get(),
-                          uri_prefix, extra_response_headers, ec, yield);
+                          uri_prefix, ec, yield);
         if (!ec) {
           // ssl shutdown (ignoring errors)
           stream.async_shutdown(yield[ec]);
@@ -1064,7 +1054,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec)
         boost::system::error_code ec;
         handle_connection(context, env, conn->socket, timeout, header_limit,
                           conn->buffer, false, pause_mutex, scheduler.get(),
-                          uri_prefix, extra_response_headers, ec, yield);
+                          uri_prefix, ec, yield);
         conn->socket.shutdown(tcp_socket::shutdown_both, ec);
       }, make_stack_allocator());
   }