[Zope] Setting content-type on HEAD request

Junio Hamano junio@twinsun.com
24 Feb 2000 00:01:07 -0800


I have the following code in standard_html_header, and

<dtml-call "RESPONSE.setHeader('content-type', 'text/html')">

when a GET request comes to the URL, the content-type header in
the HTTP response appears correctly.   However, when a HEAD
request comes, the response always appears as
application/octet-stream.  How do I correct this?

Curiously, www.zope.org:80 has the same problem.

    unix 100$ telnet www.zope.org 80
    Trying 209.67.167.55...
    Connected to www.zope.org.
    Escape character is '^]'.
    HEAD / HTTP/1.0

    HTTP/1.1 200 OK
    Date: Thu, 24 Feb 2000 07:56:44 GMT
    Server: Apache/1.3.9 (Unix)
    Connection: close
    Ms-Author-Via: DAV
    X-Powered-By: Zope (www.zope.org), Python (www.python.org)
    Content-Length: 4525
    Last-Modified: Thu, 20 Jan 2000 14:24:40 GMT
    Content-Type: application/octet-stream

    Connection closed by foreign host.
    unix 101$ telnet www.zope.org 80
    Trying 209.67.167.55...
    Connected to www.zope.org.
    Escape character is '^]'.
    GET / HTTP/1.0

    HTTP/1.1 200 OK
    Date: Thu, 24 Feb 2000 07:57:55 GMT
    Server: Apache/1.3.9 (Unix)
    Expires: Thu, 24 Feb 2000 08:12:19 GMT
    X-Powered-By: Zope (www.zope.org), Python (www.python.org)
    Content-Length: 8120
    Connection: close
    Content-Type: text/html

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    ...