]> granicus.if.org Git - apache/commitdiff
Make the SERVER_NAME variable include [ ] for literal IPv6 addresses, as
authorStefan Fritsch <sf@apache.org>
Sun, 17 Jul 2011 13:56:28 +0000 (13:56 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 17 Jul 2011 13:56:28 +0000 (13:56 +0000)
mandated by RFC 3875

PR: 26005

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

CHANGES
modules/arch/netware/mod_nw_ssl.c
modules/mappers/mod_rewrite.c
modules/ssl/ssl_engine_vars.c
server/util_expr_eval.c
server/util_script.c

diff --git a/CHANGES b/CHANGES
index eab33cecbf64d6e15bb518f805560c05d65d1db7..00ea760bdbe35e390844948c62ed19aac42a63b6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.3.14
 
+  *) core, mod_rewrite, mod_ssl, mod_nw_ssl: Make the SERVER_NAME variable
+     include [ ] for literal IPv6 addresses, as mandated by RFC 3875.
+     PR 26005. [Stefan Fritsch]
+
   *) mod_negotiation: Fix parsing of Content-Length in type maps. PR 42203.
      [Nagae Hidetake <nagae eagan jp>]
 
index bc7665617a9619a5b4e67c51ac7d6cbfac24a17a..7b64ebfa2fc99c72b64de937f45ed7d87c9b8a1c 100644 (file)
@@ -1016,7 +1016,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
             if (strcEQ(var, "SERVER_ADMIN"))
                 result = r->server->server_admin;
             else if (strcEQ(var, "SERVER_NAME"))
-                result = ap_get_server_name(r);
+                result = ap_get_server_name_for_url(r);
             else if (strcEQ(var, "SERVER_PORT"))
                 result = apr_psprintf(p, "%u", ap_get_server_port(r));
             else if (strcEQ(var, "SERVER_PROTOCOL"))
index b6fda3250a3ffc59ef6482a75fb31f8978233ceb..87855dd7ae521ba714c220b85c4316a651707480 100644 (file)
@@ -1963,7 +1963,7 @@ static char *lookup_variable(char *var, rewrite_ctx *ctx)
             switch (var[8]) {
             case 'A':
                 if (!strcmp(var, "SERVER_NAME")) {
-                    result = ap_get_server_name(r);
+                    result = ap_get_server_name_for_url(r);
                 }
                 break;
 
index 99d38325604f81aed63297b4d5152145df9766e9..34f33cf2a88342229684de608470c2438cfc879c 100644 (file)
@@ -203,7 +203,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
             if (strcEQ(var, "SERVER_ADMIN"))
                 result = r->server->server_admin;
             else if (strcEQ(var, "SERVER_NAME"))
-                result = ap_get_server_name(r);
+                result = ap_get_server_name_for_url(r);
             else if (strcEQ(var, "SERVER_PORT"))
                 result = apr_psprintf(p, "%u", ap_get_server_port(r));
             else if (strcEQ(var, "SERVER_PROTOCOL"))
index 53bd1cc1127aeb477e0fc35acdf714f28180d30a..7f5fee380537c7a86f7c72581d556d75f0b28cdb 100644 (file)
@@ -1193,7 +1193,7 @@ static const char *request_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
     case 7:
         return r->server->server_admin;
     case 8:
-        return ap_get_server_name(r);
+        return ap_get_server_name_for_url(r);
     case 9:
         return apr_psprintf(ctx->p, "%u", ap_get_server_port(r));
     case 10:
index 648e0bff974170878fb646b3963b940635c25716..fd80255360abc11a55cbf795523ad4c96fd52131 100644 (file)
@@ -229,7 +229,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
     apr_table_addn(e, "SERVER_SIGNATURE", ap_psignature("", r));
     apr_table_addn(e, "SERVER_SOFTWARE", ap_get_server_banner());
     apr_table_addn(e, "SERVER_NAME",
-                   ap_escape_html(r->pool, ap_get_server_name(r)));
+                   ap_escape_html(r->pool, ap_get_server_name_for_url(r)));
     apr_table_addn(e, "SERVER_ADDR", r->connection->local_ip);  /* Apache */
     apr_table_addn(e, "SERVER_PORT",
                   apr_psprintf(r->pool, "%u", ap_get_server_port(r)));