]> granicus.if.org Git - apache/commitdiff
new option to ServerTokens. "Maj[or]" which displays a server response
authorIan Holsman <ianh@apache.org>
Fri, 23 Aug 2002 17:24:39 +0000 (17:24 +0000)
committerIan Holsman <ianh@apache.org>
Fri, 23 Aug 2002 17:24:39 +0000 (17:24 +0000)
similar to Apache/2.0

Also surfaced the directive in the standard config, defaulting to FULL

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96500 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/conf/httpd-std.conf.in
docs/manual/mod/core.xml
include/ap_release.h
server/core.c

diff --git a/CHANGES b/CHANGES
index b9905b6f7d177fb70dda94649b1c6d849d45b09d..8c2b0f40ac216dfbf22caeced9495e9b7503086c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.41
 
+  *) New option to ServerTokens 'maj[or]'. Only show the major version
+     Also Surfaced this directive in the standard config (default FULL)
+     [Ian Holsman]
+
   *) Change mod_rewrite to use apr-util's dbm support for dbm rewrite
      maps.  The dbm type (e.g., ndbm, gdbm) can be specified on the
      RewriteMap directive.  PR 10644  [Jeff Trawick]
index ef2ab124864a0c75adff7ab6573c567081b50445..07759c09525834507cb541a2df287422cd237145 100644 (file)
@@ -501,6 +501,14 @@ CustomLog @rel_logfiledir@/access_log common
 #
 #CustomLog @rel_logfiledir@/access_log combined
 
+#
+# ServerTokens
+# This directive configures what you return as the Server HTTP response
+# Header. The default is 'Full' which sends information about the OS-Type
+# and compiled in modules.
+# Set to one of:  Full | OS | Minor | Major | Prod
+# where Full conveys the most information, and Prod the least.
+ServerTokens Full
 #
 # Optionally add a line containing the server version and virtual host
 # name to server-generated pages (internal error documents, FTP directory 
index aab92b30a1a29adfa8dc275db520b364fdf40a7e..fde44b525b8d62363592a86d63125df855fe0530 100644 (file)
@@ -2288,7 +2288,7 @@ is accessed by an incompatible browser</description>
 <directivesynopsis>
 <name>ServerTokens</name>
 <description>Configures the Server HTTP response header</description>
-<syntax>ServerTokens Minimal|ProductOnly|OS|Full</syntax>
+<syntax>ServerTokens Major|Minimal|ProductOnly|OS|Full</syntax>
 <default>ServerTokens Full</default>
 <contextlist><context>server config</context></contextlist>
 
@@ -2304,20 +2304,25 @@ is accessed by an incompatible browser</description>
       <dd>Server sends (<em>e.g.</em>): <code>Server:
       Apache</code></dd>
 
+      <dt><code>ServerTokens Maj[or]</code></dt>
+
+      <dd>Server sends (<em>e.g.</em>): <code>Server:
+      Apache/2.0</code></dd>
+
       <dt><code>ServerTokens Min[imal]</code></dt>
 
       <dd>Server sends (<em>e.g.</em>): <code>Server:
-      Apache/1.3.0</code></dd>
+      Apache/2.0.41</code></dd>
 
       <dt><code>ServerTokens OS</code></dt>
 
-      <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/1.3.0
+      <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
       (Unix)</code></dd>
 
       <dt><code>ServerTokens Full</code> (or not specified)</dt>
 
-      <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/1.3.0
-      (Unix) PHP/3.0 MyMod/1.2</code></dd>
+      <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
+      (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
     </dl>
 
     <p>This setting applies to the entire server, and cannot be
index 35783f733a5712b963d3c9c8005f5ac094888481..ec599a1b6515c06c322ff1b0e1fa1b3c3708a91b 100644 (file)
@@ -73,7 +73,9 @@
  */
 #define AP_SERVER_BASEVENDOR "Apache Software Foundation"
 #define AP_SERVER_BASEPRODUCT "Apache"
-#define AP_SERVER_BASEREVISION "2.0.41-dev"
+#define AP_SERVER_MAJORVERSION "2.0"
+#define AP_SERVER_MINORVERSION "41-dev"
+#define AP_SERVER_BASEREVISION AP_SERVER_MAJORVERSION "." AP_SERVER_MINORVERSION
 #define AP_SERVER_BASEVERSION AP_SERVER_BASEPRODUCT "/" AP_SERVER_BASEREVISION
 #define AP_SERVER_VERSION  AP_SERVER_BASEVERSION
 
index ad68dda1c43667bac7ad3a6e36c3d2069e73698b..124888aceff619165491d7c5d8d547ad9c9f20a4 100644 (file)
@@ -2286,9 +2286,10 @@ static char *server_version = NULL;
 static int version_locked = 0;
 
 enum server_token_type {
-    SrvTk_MIN,          /* eg: Apache/1.3.0 */
-    SrvTk_OS,           /* eg: Apache/1.3.0 (UNIX) */
-    SrvTk_FULL,         /* eg: Apache/1.3.0 (UNIX) PHP/3.0 FooBar/1.2b */
+    SrvTk_MAJ,          /* eg: Apache/2.0 */
+    SrvTk_MIN,          /* eg: Apache/2.0.41 */
+    SrvTk_OS,           /* eg: Apache/2.0.41 (UNIX) */
+    SrvTk_FULL,         /* eg: Apache/2.0.41 (UNIX) PHP/4.2.2 FooBar/1.2b */
     SrvTk_PRODUCT_ONLY  /* eg: Apache */
 };
 static enum server_token_type ap_server_tokens = SrvTk_FULL;
@@ -2342,6 +2343,9 @@ static void ap_set_version(apr_pool_t *pconf)
     else if (ap_server_tokens == SrvTk_MIN) {
         ap_add_version_component(pconf, AP_SERVER_BASEVERSION);
     }
+    else if (ap_server_tokens == SrvTk_MAJ) {
+        ap_add_version_component(pconf, AP_SERVER_BASEPRODUCT "/" AP_SERVER_MAJORVERSION);
+    }
     else {
         ap_add_version_component(pconf, AP_SERVER_BASEVERSION " (" PLATFORM ")");
     }
@@ -2370,6 +2374,9 @@ static const char *set_serv_tokens(cmd_parms *cmd, void *dummy,
     else if (!strcasecmp(arg, "Min") || !strcasecmp(arg, "Minimal")) {
         ap_server_tokens = SrvTk_MIN;
     }
+    else if (!strcasecmp(arg, "Maj") || !strcasecmp(arg, "Major")) {
+        ap_server_tokens = SrvTk_MAJ;
+    }
     else if (!strcasecmp(arg, "Prod") || !strcasecmp(arg, "ProductOnly")) {
         ap_server_tokens = SrvTk_PRODUCT_ONLY;
     }