httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: apache-1.3/src/modules/standard mod_alias.c
Date Thu, 31 Jan 2002 18:28:01 GMT
coar        02/01/31 10:28:01

  Modified:    src      CHANGES
               src/modules/standard mod_alias.c
  Log:
  	Fix RedirectMatch so it won't emit invalid Location fields.
  
  Revision  Changes    Path
  1.1764    +6 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1763
  retrieving revision 1.1764
  diff -u -u -r1.1763 -r1.1764
  --- CHANGES	31 Jan 2002 13:34:33 -0000	1.1763
  +++ CHANGES	31 Jan 2002 18:28:01 -0000	1.1764
  @@ -1,5 +1,11 @@
   Changes with Apache 1.3.24
   
  +  *) 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]
  +
     *) apxs: fix bug that prevented -S option from containing quotes.
        [Ben Laurie]
   
  
  
  
  1.46      +13 -2     apache-1.3/src/modules/standard/mod_alias.c
  
  Index: mod_alias.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_alias.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -u -r1.45 -r1.46
  --- mod_alias.c	15 Jan 2001 17:05:35 -0000	1.45
  +++ mod_alias.c	31 Jan 2002 18:28:01 -0000	1.46
  @@ -66,6 +66,7 @@
   
   #include "httpd.h"
   #include "http_config.h"
  +#include "http_log.h"
   
   typedef struct {
       char *real;
  @@ -391,8 +392,18 @@
       /* It may have changed since last time, so try again */
   
       if ((ret = try_alias_list(r, dirconf->redirects, 1, &status)) != NULL) {
  -	if (ap_is_HTTP_REDIRECT(status))
  -	    ap_table_setn(r->headers_out, "Location", ret);
  +        if (ap_is_HTTP_REDIRECT(status)) {
  +            if (!ap_is_url(ret)) {
  +                status = HTTP_INTERNAL_SERVER_ERROR;
  +                ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r,
  +                              "cannot redirect '%s' to '%s'; "
  +                              "target is not a valid absoluteURI",
  +                              r->uri, ret);
  +            }
  +            else {
  +                ap_table_setn(r->headers_out, "Location", ret);
  +            }
  +        }
   	return status;
       }
   
  
  
  

Mime
View raw message