]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add Http header 'Server' in response headers. 23282/head
authorZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Fri, 27 Jul 2018 08:16:22 +0000 (16:16 +0800)
committerZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Wed, 1 Aug 2018 03:23:01 +0000 (11:23 +0800)
Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/rgw/rgw_rest.cc

index 1fe4525722f77ffddddebfa841acdec5d31e63ea..5bc76e89e40d6c22395b013cae1e7f3e1aa77e0f 100644 (file)
@@ -1297,6 +1297,7 @@ OPTION(rgw_host, OPT_STR)  // host for radosgw, can be an IP, default is 0.0.0.0
 OPTION(rgw_port, OPT_STR)  // port to listen, format as "8080" "5000", if not specified, rgw will not run external fcgi
 OPTION(rgw_dns_name, OPT_STR) // hostname suffix on buckets
 OPTION(rgw_dns_s3website_name, OPT_STR) // hostname suffix on buckets for s3-website endpoint
+OPTION(rgw_service_provider_name, OPT_STR) //service provider name which is contained in http response headers
 OPTION(rgw_content_length_compat, OPT_BOOL) // Check both HTTP_CONTENT_LENGTH and CONTENT_LENGTH in fcgi env
 OPTION(rgw_lifecycle_work_time, OPT_STR) //job process lc  at 00:00-06:00s
 OPTION(rgw_lc_lock_max_time, OPT_INT)  // total run time for a single lc processor work
index 01aab9e47fa78b53599e6b661bdc2f47622b9429..66517de64272e2519e9eba50b0538eacc3b3f37f 100644 (file)
@@ -5114,6 +5114,13 @@ std::vector<Option> get_rgw_options() {
         "This is needed for virtual hosting of buckets, unless configured via zonegroup "
         "configuration."),
 
+    Option("rgw_service_provider_name", Option::TYPE_STR, Option::LEVEL_ADVANCED)
+    .set_default("")
+    .set_description("Service provider name which is contained in http response headers")
+    .set_long_description(
+        "As S3 or other cloud storage providers do, http response headers should contain the name of the provider. "
+        "This name will be placed in http header 'Server'."),
+
     Option("rgw_content_length_compat", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
     .set_default(false)
     .set_description("Multiple content length headers compatibility")
index 43b0b4564509b93db7890605b84971f54ddb42e7..1b1f21d2fba3a18c5a2d311329b47029cf8e49a9 100644 (file)
@@ -631,6 +631,7 @@ void end_header(struct 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);
 
   try {
     RESTFUL_IO(s)->complete_header();