Commit 9b787d0a authored by Yann Ylavic's avatar Yann Ylavic
Browse files

Merge r900022 from trunk.

Turn static function get_server_name_for_url() into public function
ap_get_server_name_for_url() and use it where appropriate. This fixes
mod_rewrite generating invalid URLs for redirects to IPv6 literal addresses.

Committed by: sf
Reviewed by: jailletc36, ylavic, rjung
Backported by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1678714 13f79535-47bb-0310-9956-ffa450edef68
parent b3a5a4a9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.2.30

  *) Turn static function get_server_name_for_url() into public
     ap_get_server_name_for_url() and use it where appropriate. This
     fixes mod_rewrite generating invalid URLs for redirects to IPv6
     literal addresses. PR 52831 [Stefan Fritsch]

  *) dav_validate_request: avoid validating locks and ETags when there are
     no If headers providing them on a resource we aren't modifying.
     [Ben Reser]
+0 −9
Original line number Diff line number Diff line
@@ -101,15 +101,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

   * mod_rewrite: Turn static function get_server_name_for_url() into public
     ap_get_server_name_for_url() and use it where appropriate. This
     fixes mod_rewrite generating invalid URLs for redirects to IPv6
     literal addresses.
     Fixed in 2.3.5 five years ago but repported later in 2.2.x (PR 52831)
     trunk patch: http://svn.apache.org/r900022
     2.4.x patch: http://people.apache.org/~jailletc36/PR52831.patch
     +1: jailletc36, ylavic, rjung


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+2 −1
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@
 * 20051115.34 (2.2.28) Add ap_copy_scoreboard_worker()
 * 20051115.35 (2.2.28) Add SSL reusable SNI to mod_proxy.h's proxy_conn_rec
 * 20051115.36 (2.2.28) Add r->trailers_{in,out}
 * 20051115.37 (2.2.30) Add ap_get_server_name_for_url()
 */

#define MODULE_MAGIC_COOKIE 0x41503232UL /* "AP22" */
@@ -161,7 +162,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20051115
#endif
#define MODULE_MAGIC_NUMBER_MINOR 36                    /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 37                    /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+9 −0
Original line number Diff line number Diff line
@@ -227,6 +227,15 @@ AP_DECLARE(char *) ap_construct_url(apr_pool_t *p, const char *uri, request_rec
 */
AP_DECLARE(const char *) ap_get_server_name(request_rec *r);

/**
 * Get the current server name from the request for the purposes
 * of using in a URL.  If the server name is an IPv6 literal
 * address, it will be returned in URL format (e.g., "[fe80::1]").
 * @param r The current request
 * @return the server name
 */
AP_DECLARE(const char *) ap_get_server_name_for_url(request_rec *r);

/**
 * Get the current server port
 * @param r The current request
+2 −2
Original line number Diff line number Diff line
@@ -860,7 +860,7 @@ static void fully_qualify_uri(request_rec *r)
        char *thisport;
        int port;

        thisserver = ap_get_server_name(r);
        thisserver = ap_get_server_name_for_url(r);
        port = ap_get_server_port(r);
        thisport = ap_is_default_port(port, r)
                   ? ""
@@ -4353,7 +4353,7 @@ static int hook_uri2file(request_rec *r)
     */

    /* add the canonical URI of this URL */
    thisserver = ap_get_server_name(r);
    thisserver = ap_get_server_name_for_url(r);
    port = ap_get_server_port(r);
    if (ap_is_default_port(port, r)) {
        thisport = "";
Loading