httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject [PATCH] PR#506: no DefaultType means no Content-Type
Date Sun, 04 May 1997 21:19:00 GMT
If there is no DefaultType then apache emits no Content-Type header. 

Our srm.conf-dist lists DefaultType text/plain, but httpd.h defines
DEFAULT_TYPE "text/html".  I changed httpd.h since usually the definitions
in httpd.h agree with the -dist conf files. 

mod_actions.c contained a test which always evaluates true --
default_type(r) is always non-NULL. 

Dean

Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.118
diff -c -3 -r1.118 http_protocol.c
*** http_protocol.c	1997/04/30 23:01:57	1.118
--- http_protocol.c	1997/05/04 21:14:35
***************
*** 1172,1180 ****
  {
      int i;
      const long int zero = 0L;
-     core_dir_config *dir_conf =
-       (core_dir_config *)get_module_config(r->per_dir_config, &core_module);
-     char *default_type = dir_conf->default_type;
    
      if (r->assbackwards) {
          if(!r->main)
--- 1172,1177 ----
***************
*** 1206,1213 ****
                            "byteranges; boundary=", r->boundary, NULL));
      else if (r->content_type)
          table_set(r->headers_out, "Content-Type", r->content_type);
!     else if (default_type)
!         table_set(r->headers_out, "Content-Type", default_type);
      
      if (r->content_encoding)
          table_set(r->headers_out, "Content-Encoding", r->content_encoding);
--- 1203,1210 ----
                            "byteranges; boundary=", r->boundary, NULL));
      else if (r->content_type)
          table_set(r->headers_out, "Content-Type", r->content_type);
!     else 
!         table_set(r->headers_out, "Content-Type", default_type(r));
      
      if (r->content_encoding)
          table_set(r->headers_out, "Content-Encoding", r->content_encoding);
Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache/src/httpd.h,v
retrieving revision 1.102
diff -c -3 -r1.102 httpd.h
*** httpd.h	1997/04/29 05:18:53	1.102
--- httpd.h	1997/05/04 21:14:35
***************
*** 135,141 ****
  
  /* Define this to be what type you'd like returned for files with unknown */
  /* suffixes */
! #define DEFAULT_TYPE "text/html"
  
  /* Define this to be what your per-directory security files are called */
  #ifdef __EMX__
--- 135,141 ----
  
  /* Define this to be what type you'd like returned for files with unknown */
  /* suffixes */
! #define DEFAULT_TYPE "text/plain"
  
  /* Define this to be what your per-directory security files are called */
  #ifdef __EMX__
Index: mod_actions.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_actions.c,v
retrieving revision 1.11
diff -c -3 -r1.11 mod_actions.c
*** mod_actions.c	1997/03/07 14:15:37	1.11
--- mod_actions.c	1997/05/04 21:14:35
***************
*** 177,183 ****
          return DECLINED;
  
      /* Second, check for actions (which override the method scripts) */
!     if ((action || default_type(r)) && (t = table_get(conf->action_types,
  					action ? action : default_type(r)))) {
          script = t;
  	if (r->finfo.st_mode == 0) {
--- 177,183 ----
          return DECLINED;
  
      /* Second, check for actions (which override the method scripts) */
!     if ((t = table_get(conf->action_types,
  					action ? action : default_type(r)))) {
          script = t;
  	if (r->finfo.st_mode == 0) {



Mime
View raw message