]> granicus.if.org Git - apache/commitdiff
If the RedirectMatch target is an abs_path, make it an absoluteURI
authorKen Coar <coar@apache.org>
Thu, 31 Jan 2002 20:38:08 +0000 (20:38 +0000)
committerKen Coar <coar@apache.org>
Thu, 31 Jan 2002 20:38:08 +0000 (20:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93143 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/mappers/mod_alias.c

diff --git a/CHANGES b/CHANGES
index a35f1ad07a3a66b8f435dfb603d83bd900e4f39d..a862d4daba2c564e9646440b7e70a20c2cb9b17a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,8 +3,9 @@ Changes with Apache 2.0.32-dev
   *) The Location: response header field, used for external
      redirect, *must* be an absoluteURI.  The Redirect directive
      tested for that, but RedirectMatch didn't -- it would allow
-     almost anything through.  Now it, too, will correctly varf
-     if the redirection target isn't an absoluteURI.  [Ken Coar]
+     almost anything through.  Now it will try to turn an abs_path
+     into an absoluteURI, but it will correctly varf like Redirect
+     if the final redirection target isn't an absoluteURI.  [Ken Coar]
 
 Changes with Apache 2.0.31
 
diff --git a/STATUS b/STATUS
index e2ef3f5ce0c5355adec4a1027b389027402a6bc3..cb11c5d03645baabdf4f28ad7963cddc68d64fa2 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                             -*-text-*-
-Last modified at [$Date: 2002/01/31 19:54:53 $]
+Last modified at [$Date: 2002/01/31 20:38:07 $]
 
 Release:
 
@@ -104,9 +104,6 @@ RELEASE SHOWSTOPPERS:
       apr-util, etc.
         Message-ID: <20020116000226.GA15991@ebuilt.com>
 
-    * mod_alias redirections are issuing invalid Location:
-      response header fields (they're not absoluteURI values).
-
 RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP:
 
     * Modify the worker MPM so that it doesn't need to create and
index d79917c16a86ec913f763cfd60f40bbe22003a2d..8a3150f339841c394e8904e5c5116e3ef3d52c65 100644 (file)
@@ -72,6 +72,7 @@
 
 #include "ap_config.h"
 #include "httpd.h"
+#include "http_core.h"
 #include "http_config.h"
 #include "http_request.h"
 #include "http_log.h"
@@ -435,11 +436,20 @@ static int fixup_redir(request_rec *r)
 
     if ((ret = try_alias_list(r, dirconf->redirects, 1, &status)) != NULL) {
         if (ap_is_HTTP_REDIRECT(status)) {
+            if (ret[0] == '/') {
+                char *orig_target = ret;
+
+                ret = ap_construct_url(r->pool, ret, r);
+                ap_log_rerror(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, r,
+                              "incomplete redirection target of '%s' for "
+                              "URI '%s' modified to '%s'",
+                              orig_target, r->uri, ret);
+            }
             if (!ap_is_url(ret)) {
                 status = HTTP_INTERNAL_SERVER_ERROR;
                 ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
                               "cannot redirect '%s' to '%s'; "
-                              "target is not a valid absoluteURI",
+                              "target is not a valid absoluteURI or abs_path",
                               r->uri, ret);
             }
             else {