Apache 1.3.x: What headers are added just before response is sent?

Apache 1.3.x: What headers are added just before response is sent?

Post by Dan Wilg » Thu, 21 Dec 2000 01:37:05

Quote:> Here is a snippet of text from the Apache 1.3.12 online documentation:

> "The Header directives are processed just before the response is sent
> by its handler. These means that some headers that are added just
> before the response is sent cannot be unset or overridden. This
> includes headers such as "Date" and "Server". "

If you're using a CGI script to generate the headers, then only Date, Server,
and "Connection: close" are added. You can confirm this by using a script like

  print "Status: 200\nContent-type: text/plain\n\nBoo!";

and then connect to your server with:

  telnet <hostname> 80
  GET /path-to-cgi-program-above HTTP/1.0

(be sure to hit return twice at the end)

Unless you have other modules installed that I don't, you'll see that the only
headers returned are exactly what was used in the script (Status gets
modified), plus the ones I listed.

** Remove the REMOVE in my address address to reply reply  **


Apache 1.3.x: What headers are added just before response is sent?

Post by Nick K » Thu, 21 Dec 2000 06:47:42

Quote:> I'm going to guess that Date: and Server: are untouchable[1], and
> [1] Unless you hack the source. ;)

Or use nph-cgi, or mod_asis, or ...

(Haven't tried it recently, but Apache will also happily serve up
multiple instances of a header like Server: if provoked).

Nick Kew

Site Valet - the essential service for anyone with a Website.
Now available at <URL:http://valet.webthing.com/>


1. Apache 1.3.20: ap_send_http_header() sends Content-Type header when response contains no body

The following Apache 1.3.20 code in ap_send_http_header() always
generates a Content-Type message header, even when the response to to
have no body:

    if (r->byterange > 1)
        ap_table_setn(r->headers_out, "Content-Type",
                  ap_pstrcat(r->pool, "multipart", use_range_x(r) ?
"/x-" : "/",
                          "byteranges; boundary=", r->boundary,
    else ap_table_setn(r->headers_out, "Content-Type",

I would think that a Content-Type message header should not be
included in a response that has no body.  Is this a known problem in

Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
CMVC95 WebDAV Development
IBM Corporation

2. Oracle8 on Solrais 8

3. What am I missing not running 1.3.8x ?

4. Unable to get Solaris 8 DHCP service running

5. CDE 1.3: Hangs/Core Dumps for automounted logins: What am I doing wrong?

6. 2.5.26 hotplug failure

7. This clone thing...am I stupid, or am I right?

8. Terminal Velocity + DOSEMU 0.60.1

9. I am with the following error, when i am running lilo...

10. Am I touchy? Or am I right?

11. Am I seeing IPv5, or am I hallucinating?

12. I am buying an Ultra 5 but am lost in part numbers ....