httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c
Date Tue, 14 Nov 2000 04:52:36 GMT
rbb         00/11/13 20:52:35

  Modified:    src      CHANGES
               src/main http_protocol.c
  Log:
  If the content-length is zero, then we don't output the Content-Length
  header file.  The only time that the C-L should be zero is if there is
  no body.  Zero is a valid content-length, but the only time that we ever
  really send it is on a HEAD request right now, and that is incorrect.
  The HEAD response should have the actual content's length.
  
  Revision  Changes    Path
  1.326     +6 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.325
  retrieving revision 1.326
  diff -u -r1.325 -r1.326
  --- CHANGES	2000/11/14 02:42:51	1.325
  +++ CHANGES	2000/11/14 04:52:33	1.326
  @@ -1,4 +1,10 @@
   Changes with Apache 2.0a8
  +  *) If the Content-Length is zero, we shouldn't output that header
  +     field.  The only time that this field should ever be zero, is if the
  +     request has no body.  But, if it is a HEAD request then we should
  +     be outputing the length of the actual body.
  +     [Ryan Bloom]
  +
     *) Add the referer to the error log if one is available.
        [Markus Gyger <mgyger@itr.ch>]
   
  
  
  
  1.243     +4 -0      apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.242
  retrieving revision 1.243
  diff -u -r1.242 -r1.243
  --- http_protocol.c	2000/11/13 22:52:19	1.242
  +++ http_protocol.c	2000/11/14 04:52:33	1.243
  @@ -2490,6 +2490,10 @@
           apr_table_addn(r->headers_out, "Expires", date);
       }
   
  +    if (!strcmp(apr_table_get(r->headers_out, "Content-Length"), "0")) {
  +        apr_table_unset(r->headers_out, "Content-Length");
  +    }
  +
       apr_table_do((int (*) (void *, const char *, const char *)) compute_header_len,
                    (void *) &len, r->headers_out, NULL);
       
  
  
  

Mime
View raw message