util_script: Make REDIRECT_URL a complete URL (where set).

PR 57785

Submitted by: niq
Reviewed by: jim, minfrin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1705496 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Graham Leggett
2015-09-26 22:44:23 +00:00
parent 7b14c8c876
commit f6cd7e170f
3 changed files with 17 additions and 7 deletions

View File

@ -2,6 +2,8 @@
Changes with Apache 2.4.17 Changes with Apache 2.4.17
*) core/util_script: make REDIRECT_URL a full URL. PR 57785. [Nick Kew]
*) MPMs: Support SO_REUSEPORT to create multiple duplicated listener *) MPMs: Support SO_REUSEPORT to create multiple duplicated listener
records for scalability. [Yingqi Lu <yingqi.lu@intel.com>, records for scalability. [Yingqi Lu <yingqi.lu@intel.com>,
Jeff Trawick, Jim Jagielski, Yann Ylavic] Jeff Trawick, Jim Jagielski, Yann Ylavic]

5
STATUS
View File

@ -109,11 +109,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK: PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ] [ start all new proposals below, under PATCHES PROPOSED. ]
*) util_script: Make REDIRECT_URL a complete URL (where set).
PR 57785
trunk: http://svn.apache.org/viewvc?view=revision&revision=1677702
2.4.x: trunk patch applies.
+1: niq, jim, minfrin
PATCHES PROPOSED TO BACKPORT FROM TRUNK: PATCHES PROPOSED TO BACKPORT FROM TRUNK:

View File

@ -282,12 +282,25 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
/* Apache custom error responses. If we have redirected set two new vars */ /* Apache custom error responses. If we have redirected set two new vars */
if (r->prev) { if (r->prev) {
/* PR#57785: reconstruct full URL here */
apr_uri_t *uri = &r->prev->parsed_uri;
if (!uri->scheme) {
uri->scheme = (char*)ap_http_scheme(r->prev);
}
if (!uri->port) {
uri->port = ap_get_server_port(r->prev);
uri->port_str = apr_psprintf(r->pool, "%u", uri->port);
}
if (!uri->hostname) {
uri->hostname = (char*)ap_get_server_name_for_url(r->prev);
}
add_unless_null(e, "REDIRECT_QUERY_STRING", r->prev->args); add_unless_null(e, "REDIRECT_QUERY_STRING", r->prev->args);
add_unless_null(e, "REDIRECT_URL", r->prev->uri); add_unless_null(e, "REDIRECT_URL",
apr_uri_unparse(r->pool, uri, 0));
} }
if (e != r->subprocess_env) { if (e != r->subprocess_env) {
apr_table_overlap(r->subprocess_env, e, APR_OVERLAP_TABLES_SET); apr_table_overlap(r->subprocess_env, e, APR_OVERLAP_TABLES_SET);
} }
} }