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 Wed, 20 Aug 2003 00:35:48 GMT
nd          2003/08/19 17:35:48

  Modified:    .        CHANGES
               modules/mappers mod_rewrite.c
  Log:
  allow [T=...] forced types to get expanded.
  
  PR: 14223
  
  Revision  Changes    Path
  1.1259    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1258
  retrieving revision 1.1259
  diff -u -r1.1258 -r1.1259
  --- CHANGES	19 Aug 2003 16:03:02 -0000	1.1258
  +++ CHANGES	20 Aug 2003 00:35:48 -0000	1.1259
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_rewrite: Allow forced mimetypes [T=...] to get expanded.
  +     PR 14223.  [André Malo]
  +
     *) mod_log_config: Fix %b log format to write really "-" when 0 bytes
        were sent (e.g. with 304 or 204 response codes).  [Astrid Keßler]
   
  
  
  
  1.232     +18 -9     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.231
  retrieving revision 1.232
  diff -u -r1.231 -r1.232
  --- mod_rewrite.c	19 Aug 2003 22:37:38 -0000	1.231
  +++ mod_rewrite.c	20 Aug 2003 00:35:48 -0000	1.232
  @@ -3221,7 +3221,6 @@
       case 'T':
           if (!*key || !strcasecmp(key, "ype")) {            /* type */
               cfg->forced_mimetype = val;
  -            ap_str_tolower(cfg->forced_mimetype);
           }
           break;
   
  @@ -3585,11 +3584,16 @@
       /* non-substitution rules ('RewriteRule <pat> -') end here. */
       if (p->flags & RULEFLAG_NOSUB) {
           if (p->forced_mimetype) {
  -            rewritelog((r, 2, ctx->perdir, "remember %s to have MIME-type '%s'",
  -                        r->filename, p->forced_mimetype));
  +            char *type = do_expand(p->forced_mimetype, ctx);
  +
  +            if (*type) {
  +                ap_str_tolower(type);
   
  -            apr_table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR,
  -                           p->forced_mimetype);
  +                rewritelog((r, 2, ctx->perdir, "remember %s to have MIME-type "
  +                            "'%s'", r->filename, type));
  +
  +                apr_table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR, type);
  +            }
           }
   
           return 2;
  @@ -3666,11 +3670,16 @@
   
       /* Finally remember the forced mime-type */
       if (p->forced_mimetype) {
  -        rewritelog((r, 2, ctx->perdir, "remember %s to have MIME-type '%s'",
  -                    r->filename, p->forced_mimetype));
  +        char *type = do_expand(p->forced_mimetype, ctx);
   
  -        apr_table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR,
  -                       p->forced_mimetype);
  +        if (*type) {
  +            ap_str_tolower(type);
  +
  +            rewritelog((r, 2, ctx->perdir, "remember %s to have MIME-type '%s'",
  +                        r->filename, type));
  +
  +            apr_table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR, type);
  +        }
       }
   
       /* Puuhhhhhhhh... WHAT COMPLICATED STUFF ;_)
  
  
  

Mime
View raw message