httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r1677702 - in /httpd/httpd/trunk: CHANGES server/util_script.c
Date Mon, 04 May 2015 22:05:14 GMT
Author: niq
Date: Mon May  4 22:05:14 2015
New Revision: 1677702

URL: http://svn.apache.org/r1677702
Log:
Make REDIRECT_URL a complete URL (where set).
PR 57785

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/util_script.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1677702&r1=1677701&r2=1677702&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon May  4 22:05:14 2015
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) core/util_script: make REDIRECT_URL a full URL.  PR 57785. [Nick Kew]
+
   *) mod_ssl: Check for the Entropy Gathering Daemon (EGD) availability at
      configure time (RAND_egd), and complain if SSLRandomSeed requires using
      it otherwise.  [Bernard Spil <pil.oss gmail com>, Stefan Sperling,

Modified: httpd/httpd/trunk/server/util_script.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_script.c?rev=1677702&r1=1677701&r2=1677702&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_script.c (original)
+++ httpd/httpd/trunk/server/util_script.c Mon May  4 22:05:14 2015
@@ -282,12 +282,25 @@ AP_DECLARE(void) ap_add_common_vars(requ
     /* 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);
     }
 }
 



Mime
View raw message