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, 05 Aug 2003 23:04:06 GMT
nd          2003/08/05 16:04:06

  Modified:    .        CHANGES
               modules/mappers mod_rewrite.c
  Log:
  hook mimetype-forcing into fixup/LAST. This leads to consistent
  behaviour (server context vs. directory context), overrides all statically
  configured mime types and doesn't clobber multiviews any longer.
  
  Revision  Changes    Path
  1.1246    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1245
  retrieving revision 1.1246
  diff -u -r1.1245 -r1.1246
  --- CHANGES	31 Jul 2003 23:50:45 -0000	1.1245
  +++ CHANGES	5 Aug 2003 23:04:04 -0000	1.1246
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_rewrite: RewriteRules in server context using the force
  +     type feature [T=...] no longer disable MultiViews.  [André Malo]
  +
     *) ab: Work over non-loopback on Unix again. PR 21495. [Jeff Trawick]
   
     *) mod_rewrite: In external rewrite maps lookup keys containing
  
  
  
  1.223     +8 -32     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.222
  retrieving revision 1.223
  diff -u -r1.222 -r1.223
  --- mod_rewrite.c	5 Aug 2003 21:18:47 -0000	1.222
  +++ mod_rewrite.c	5 Aug 2003 23:04:05 -0000	1.223
  @@ -3580,37 +3580,18 @@
        *  we stop processing and return immediately. The only thing
        *  we have not to forget are the environment variables and
        *  cookies:
  -     *  (`RewriteRule <pat> - [E=...,CO=...]')
  +     *  (`RewriteRule <pat> - [E=...,CO=...,T=...]')
        */
       if (output[0] == '-' && !output[1]) {
           do_expand_env(r, p->env, briRR, briRC);
           do_expand_cookie(r, p->cookie, briRR, briRC);
  -        if (p->forced_mimetype != NULL) {
  -            if (perdir == NULL) {
  -                /* In the per-server context we can force the MIME-type
  -                 * the correct way by notifying our MIME-type hook handler
  -                 * to do the job when the MIME-type API stage is reached.
  -                 */
  -                rewritelog((r, 2, NULL, "remember %s to have MIME-type '%s'",
  -                            r->filename, p->forced_mimetype));
  -                apr_table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR,
  -                               p->forced_mimetype);
  -            }
  -            else {
  -                /* In per-directory context we operate in the Fixup API hook
  -                 * which is after the MIME-type hook, so our MIME-type handler
  -                 * has no chance to set r->content_type. And because we are
  -                 * in the situation where no substitution takes place no
  -                 * sub-request will happen (which could solve the
  -                 * restriction). As a workaround we do it ourself now
  -                 * immediately although this is not strictly API-conforming.
  -                 * But it's the only chance we have...
  -                 */
  -                rewritelog((r, 1, perdir, "force %s to have MIME-type '%s'",
  -                            r->filename, p->forced_mimetype));
  -                ap_set_content_type(r, p->forced_mimetype);
  -            }
  +        if (p->forced_mimetype) {
  +            rewritelog((r, 2, perdir, "remember %s to have MIME-type '%s'",
  +                        r->filename, p->forced_mimetype));
  +            apr_table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR,
  +                           p->forced_mimetype);
           }
  +
           return 2;
       }
   
  @@ -4714,11 +4695,6 @@
        */
       static const char * const aszPre[]={ "mod_proxy.c", NULL };
   
  -    /* check type before mod_mime, so that [T=foo/bar] will not be
  -     * overridden by AddType definitions.
  -     */
  -    static const char * const ct_aszSucc[]={ "mod_mime.c", NULL };
  -
       APR_REGISTER_OPTIONAL_FN(ap_register_rewrite_mapfunc);
   
       ap_hook_handler(handler_redirect, NULL, NULL, APR_HOOK_MIDDLE);
  @@ -4727,8 +4703,8 @@
       ap_hook_child_init(init_child, NULL, NULL, APR_HOOK_MIDDLE);
   
       ap_hook_fixups(hook_fixup, aszPre, NULL, APR_HOOK_FIRST);
  +    ap_hook_fixups(hook_mimetype, NULL, NULL, APR_HOOK_LAST);
       ap_hook_translate_name(hook_uri2file, NULL, NULL, APR_HOOK_FIRST);
  -    ap_hook_type_checker(hook_mimetype, NULL, ct_aszSucc, APR_HOOK_MIDDLE);
   }
   
       /* the main config structure */
  
  
  

Mime
View raw message