[Zope] Stop zope from adding <html><head></head> to my method
Junio Hamano
junio@twinsun.com
25 Feb 2000 10:27:58 -0800
>>>>> "LS" == Loren Stafford <lstaffor@dynalogic.com> writes:
LS> It's Zope. If it doesn't know the content-type, it guesses by scanning the
LS> doc. XML looks like HTML to this simple scanner. Either you explicitly set
LS> the content-type in RESPONSE, or there's some kind of junk you can put at
LS> the top of the doc that will tip off the scanner.
I have the following code in standard_html_header to force the
content type explicitly, 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. Does anybody know how to 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">
...