httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Tue, 19 Aug 2003 00:52:43 GMT
nd          2003/08/18 17:52:43

  Modified:    .        CHANGES
               modules/mappers mod_rewrite.c
  Log:
  Catch an edge case, where strange subsequent RewriteRules
  could lead to a 400 (Bad Request) response. Example:
  
  <Directory /path>
      RewriteEngine on
      RewriteBase /
      RewriteRule foo /bar
      RewriteRule bar baz
  </Directory>
  
  Revision  Changes    Path
  1.1256    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1255
  retrieving revision 1.1256
  diff -u -r1.1255 -r1.1256
  --- CHANGES	19 Aug 2003 00:36:58 -0000	1.1255
  +++ CHANGES	19 Aug 2003 00:52:43 -0000	1.1256
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_rewrite: Catch an edge case, where strange subsequent RewriteRules
  +     could lead to a 400 (Bad Request) response.  [André Malo]
  +
     *) mod_rewrite: Fix LA-U and LA-F lookups in directory context. Previously
        the current rewrite state was just used as lookup path, which lead to
        strange and often useless results. Related to PR 8493.  [André Malo]
  
  
  
  1.228     +2 -6      httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.227
  retrieving revision 1.228
  diff -u -r1.227 -r1.228
  --- mod_rewrite.c	19 Aug 2003 00:36:58 -0000	1.227
  +++ mod_rewrite.c	19 Aug 2003 00:52:43 -0000	1.228
  @@ -3474,7 +3474,6 @@
       regex_t *regexp;
       regmatch_t regmatch[MAX_NMATCH];
       exp_ctx *ctx = NULL;
  -    int prefixstrip;
       int failed;
       apr_array_header_t *rewriteconds;
       rewritecond_entry *conds;
  @@ -3505,14 +3504,12 @@
        *  the local part.  Additionally indicate this special
        *  threatment in the logfile.
        */
  -    prefixstrip = 0;
  -    if (perdir != NULL) {
  +    if (perdir) {
           if (   strlen(uri) >= strlen(perdir)
               && strncmp(uri, perdir, strlen(perdir)) == 0) {
               rewritelog((r, 3, perdir, "strip per-dir prefix: %s -> %s",
                           uri, uri+strlen(perdir)));
               uri = uri+strlen(perdir);
  -            prefixstrip = 1;
           }
       }
   
  @@ -3684,8 +3681,7 @@
        *   location, i.e. if it's not an absolute URL (!) path nor
        *   a fully qualified URL scheme.
        */
  -    if (prefixstrip && *r->filename != '/'
  -                    && !is_absolute_uri(r->filename)) {
  +    if (perdir && *r->filename != '/' && !is_absolute_uri(r->filename))
{
           rewritelog((r, 3, perdir, "add per-dir prefix: %s -> %s%s",
                       r->filename, perdir, r->filename));
           r->filename = apr_pstrcat(r->pool, perdir, r->filename, NULL);
  
  
  

Mime
View raw message