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
API_EXPORT(void) ap_basic_http_header(request_rec *r)
{
char *protocol;
+ const char *server;
if (r->assbackwards)
return;
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