Feature #357

Patch: Set CGI var SERVER_SOFTWARE to server.tag

Added by Anonymous about 9 years ago. Updated over 5 years ago.

Status:FixedStart date:
Priority:LowDue date:
Assignee:jan% Done:

100%

Category:mod_cgi
Target version:1.4.23
Missing in 1.5.x:

Description


--- mod_cgi.c.orig      Sun Sep 25 23:25:20 2005
+++ mod_cgi.c   Mon Nov  7 11:05:37 2005
@@ -762,7 +762,12 @@
                env.size = 0;
                env.used = 0;

-               cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
+               if (buffer_is_empty(con->conf.server_tag)) {
+                       cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
+               } else {
+                       cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), con->conf.server_tag);
+               }
+
                cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), 
                            con->server_name->used ?
                            con->server_name->ptr :
--- mod_scgi.c.orig     Mon Oct 31 15:58:07 2005
+++ mod_scgi.c  Mon Nov  7 11:05:37 2005
@@ -1434,8 +1434,12 @@
        scgi_env_add(p->scgi_env, CONST_STR_LEN("SCGI"), CONST_STR_LEN("1"));

-       scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
-       
+       if (buffer_is_empty(con->conf.server_tag)) {
+               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
+       } else {
+               scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
+       }
+
        if (con->server_name->used) {
                scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
        } else {
--- mod_fastcgi.c.orig  Mon Oct 31 15:57:03 2005
+++ mod_fastcgi.c       Mon Nov  7 11:05:37 2005
@@ -1649,8 +1649,12 @@
        buffer_prepare_copy(p->fcgi_env, 1024);

-       fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
-       
+       if (buffer_is_empty(con->conf.server_tag)) {
+               fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
+       } else {
+               fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_BUF_LEN(con->conf.server_tag));
+       }
+
        if (con->server_name->used) {
                fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
        } else {

-- aw


Related issues

Duplicated by Feature #1704: Set FCGI var SERVER_SOFTWARE to server.tag Fixed

Associated revisions

Revision 2471
Added by stbuehler over 5 years ago

Use server.tag for SERVER_SOFTWARE if configured (fixes #357)

History

#1 Updated by stbuehler over 5 years ago

  • Target version set to 1.4.23
  • Pending set to No
  • Patch available set to No

#2 Updated by stbuehler over 5 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2471.

Also available in: Atom