You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2002/04/17 06:09:07 UTC

cvs commit: httpd-2.0/modules/http http_protocol.c http_request.c

jerenkrantz    02/04/16 21:09:07

  Modified:    .        CHANGES
               modules/http http_protocol.c http_request.c
  Log:
  Fix subreqs with non-defined Content-Types being served improperly.
  
  If we do not know a C-T for a subreq, we *must* propogate that
  non-knowledge upwards to the main request.
  
  Previously, if you used a DirectoryIndex with a file without a C-T (say
  .shtml without AddType), the r->content_type will be kept as
  httpd/unix-directory when we promoted the subreq in mod_dir.  Since there
  would be no handler on this file, ap_invoke_handler (config.c:355) would
  set the handler to be httpd/unix-directory (which was the old C-T of the
  dir).  This would then trigger the handler to become httpd/unix-directory.
  mod_autoindex would then try to serve the request.  But, the filename
  was propogated upwards by mod_dir's DirectoryIndex via
  internal_fast_redirect - it would then return a 403 trying to generate a
  mod_autoindex page for a file.
  
  Now, we will use ap_default_type() which is correct.
  
  Revision  Changes    Path
  1.710     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.709
  retrieving revision 1.710
  diff -u -r1.709 -r1.710
  --- CHANGES	16 Apr 2002 08:49:01 -0000	1.709
  +++ CHANGES	17 Apr 2002 04:09:06 -0000	1.710
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.36
   
  +  *) Fix subreqs with non-defined Content-Types being served improperly.
  +     [Justin Erenkrantz]
  +
     *) Merge in latest GNU config.guess and config.sub files.  PR 7818.
        [Justin Erenkrantz]
   
  
  
  
  1.411     +4 -1      httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.410
  retrieving revision 1.411
  diff -u -r1.410 -r1.411
  --- http_protocol.c	16 Apr 2002 05:50:37 -0000	1.410
  +++ http_protocol.c	17 Apr 2002 04:09:07 -0000	1.411
  @@ -1297,7 +1297,10 @@
   
   AP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct)
   {
  -    if (!r->content_type || strcmp(r->content_type, ct)) {
  +    if (!ct) {
  +        r->content_type = NULL;
  +    }
  +    else if (!r->content_type || strcmp(r->content_type, ct)) {
           r->content_type = ct;
   
           /* Insert filters requested by the AddOutputFiltersByType 
  
  
  
  1.140     +1 -3      httpd-2.0/modules/http/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
  retrieving revision 1.139
  retrieving revision 1.140
  diff -u -r1.139 -r1.140
  --- http_request.c	5 Apr 2002 21:24:13 -0000	1.139
  +++ http_request.c	17 Apr 2002 04:09:07 -0000	1.140
  @@ -422,9 +422,7 @@
       r->args = rr->args;
       r->finfo = rr->finfo;
       r->handler = rr->handler;
  -    if (rr->content_type) {
  -        ap_set_content_type(r, rr->content_type);
  -    }
  +    ap_set_content_type(r, rr->content_type);
       r->content_encoding = rr->content_encoding;
       r->content_languages = rr->content_languages;
       r->per_dir_config = rr->per_dir_config;