[Zope] Incorrect content-type returned by ZServer

David S. Harrison dsh@magma-da.com
Wed, 01 Dec 1999 10:50:49 -0800


I have a Zope 2.0.1 application that is working pretty well except that
one page is given the wrong content-type by ZServer.  The page in
question is a DTML document with CGI parameters.  I wrote a debugging
application in Java to trap the input and output between the browser
and the server.  Here is a log from a successful transaction:

3>GET /test/QOR/TestCasePage?testcase=ct&days=14 HTTP/1.0
3>Referer: http://pc3-10:9099/test/QOR
3>Connection: Keep-Alive
3>User-Agent: Mozilla/4.7 [en] (WinNT; U)
3>Host: pc3-10:9099
3>Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
3>Accept-Encoding: gzip
3>Accept-Language: en
3>Accept-Charset: iso-8859-1,*,utf-8
3>
3<HTTP/1.0 200 OK
3<Server: Zope/(unreleased version) ZServer/1.1b1
3<Date: Wed, 01 Dec 1999 18:27:56 GMT
3<Connection: close
3<Content-Type: text/html
3<Content-Length: 11285
3<
3<<HTML>
... The page as expected ...

And here is the transaction from the unsuccessful transaction:

4>GET /test/QOR/TestCasePage?testcase=fa&days=14 HTTP/1.0
4>Referer: http://pc3-10:9099/test/QOR
4>Connection: Keep-Alive
4>User-Agent: Mozilla/4.7 [en] (WinNT; U)
4>Host: pc3-10:9099
4>Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
4>Accept-Encoding: gzip
4>Accept-Language: en
4>Accept-Charset: iso-8859-1,*,utf-8
4>
4>HTTP/1.0 200 OK
4<Server: Zope/(unreleased version) ZServer/1.1b1
4<Date: Wed, 01 Dec 1999 18:28:05 GMT
4<Connection: close
4<Content-Type: application/octet-stream
4<Content-Length: 19571
4<
4<<HTML>

Note that the two pages are exactly the same.  The only difference
is one CGI argument (testcase).  But in the latter transaction,
ZServer returns a content type of "application/octet-stream" instead
of "text/html".  This causes the browser to try to save the file
instead of displaying it.

Does this ring any bells?  Any workarounds?  Right now, this problem
looks like it is not directly under my control.

			David S. Harrison
			(dsh@magma-da.com)