summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorNick Kew <niq@apache.org>2015-05-05 00:05:14 +0200
committerNick Kew <niq@apache.org>2015-05-05 00:05:14 +0200
commit5a649184dc46d7aea330d91d42420c1f79ebdbed (patch)
tree61f2da0ff355a17eda158cdc4c399ec5a017ef8f /server
parentconst goodness (diff)
downloadapache2-5a649184dc46d7aea330d91d42420c1f79ebdbed.tar.xz
apache2-5a649184dc46d7aea330d91d42420c1f79ebdbed.zip
Make REDIRECT_URL a complete URL (where set).
PR 57785 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1677702 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/util_script.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/server/util_script.c b/server/util_script.c
index a8d9ebc4f0..14991cd0ff 100644
--- a/server/util_script.c
+++ b/server/util_script.c
@@ -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 */
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_URL", r->prev->uri);
+ add_unless_null(e, "REDIRECT_URL",
+ apr_uri_unparse(r->pool, uri, 0));
}
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);
}
}