diff options
author | Eric Covener <covener@apache.org> | 2015-10-24 21:13:16 +0200 |
---|---|---|
committer | Eric Covener <covener@apache.org> | 2015-10-24 21:13:16 +0200 |
commit | 28d2d122419e5e03577f3aabf3b9cc83af8273c3 (patch) | |
tree | d2814c3503490be87c866bda1b2dabb998b6852e /server/util_script.c | |
parent | announce protocol choices on first request (diff) | |
download | apache2-28d2d122419e5e03577f3aabf3b9cc83af8273c3.tar.xz apache2-28d2d122419e5e03577f3aabf3b9cc83af8273c3.zip |
Make the fix for fully qualifying REDIRECT_URL from PR#57785 opt-in.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710380 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/util_script.c')
-rw-r--r-- | server/util_script.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/server/util_script.c b/server/util_script.c index 4ec4bb58c0..de9e91dd2b 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -286,21 +286,26 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r) /* Apache custom error responses. If we have redirected set two new vars */ 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); + if (conf->fully_qualify_redirect_url != AP_CORE_CONFIG_ON) { + add_unless_null(e, "REDIRECT_URL", r->prev->uri); + } + else { + /* 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_URL", + apr_uri_unparse(r->pool, uri, 0)); } add_unless_null(e, "REDIRECT_QUERY_STRING", r->prev->args); - add_unless_null(e, "REDIRECT_URL", - apr_uri_unparse(r->pool, uri, 0)); } if (e != r->subprocess_env) { |