httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: apache-1.3/src/main http_protocol.c
Date Thu, 21 Mar 2002 14:49:47 GMT
minfrin     02/03/21 06:49:47

  Modified:    src      CHANGES
               src/main http_protocol.c
  Log:
  When a proxied site was being served, Apache was replacing
  the original site Server header with it's own, which is not
  allowed by RFC2616. Fixed.
  
  Revision  Changes    Path
  1.1791    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1790
  retrieving revision 1.1791
  diff -u -r1.1790 -r1.1791
  --- CHANGES	21 Mar 2002 14:37:42 -0000	1.1790
  +++ CHANGES	21 Mar 2002 14:49:46 -0000	1.1791
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.24
   
  +  *) When a proxied site was being served, Apache was replacing
  +     the original site Server header with it's own, which is not
  +     allowed by RFC2616. Fixed. [Graham Leggett]
  +
     *) Change ap_construct_url() so that the r->hostname is used in
        the URL instead of the value of the ServerName directive. This
        stops Apache redirecting to a different website name to the
  
  
  
  1.312     +13 -3     apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.311
  retrieving revision 1.312
  diff -u -r1.311 -r1.312
  --- http_protocol.c	13 Mar 2002 21:05:31 -0000	1.311
  +++ http_protocol.c	21 Mar 2002 14:49:46 -0000	1.312
  @@ -1513,6 +1513,7 @@
   API_EXPORT(void) ap_basic_http_header(request_rec *r)
   {
       char *protocol;
  +    const char *server;
   
       if (r->assbackwards)
           return;
  @@ -1535,13 +1536,22 @@
       PUSH_EBCDIC_OUTPUTCONVERSION_STATE_r(r, 1);
   #endif /*CHARSET_EBCDIC*/
   
  -    /* Output the HTTP/1.x Status-Line and the Date and Server fields */
  -
  +    /* output the HTTP/1.x Status-Line */
       ap_rvputs(r, protocol, " ", r->status_line, CRLF, NULL);
   
  +    /* output the date header */
       ap_send_header_field(r, "Date", ap_gm_timestr_822(r->pool, r->request_time));
  -    ap_send_header_field(r, "Server", ap_get_server_version());
   
  +    /* keep a previously set server header (possible from proxy), otherwise
  +     * generate a new server header */
  +    if (server = ap_table_get(r->headers_out, "Server")) {
  +        ap_send_header_field(r, "Server", server);
  +    }
  +    else {
  +        ap_send_header_field(r, "Server", ap_get_server_version());
  +    }
  +
  +    /* unset so we don't send them again */
       ap_table_unset(r->headers_out, "Date");        /* Avoid bogosity */
       ap_table_unset(r->headers_out, "Server");
   #ifdef CHARSET_EBCDIC
  
  
  

Mime
View raw message