Jeff Hoffman writes:
 > ....
 > In the index_html method, I have:
 > 
 >   RESPONSE.setHeader('Content-Type', 'video/foo')
 >   RESPONSE.setHeader('Content-Length', 1212)
 > ....
 > However, when I telnet to my web port and do:
 > 
 >   HEAD /path/to/myfile.mpg HTTP/1.0
 > 
 > I get:
 > 
 >   Content-Type: video/mpeg
 >   Content-Length: 0

The problem is, that a HEAD request does not execute
"index_html".
Instead, the "HEAD" method from "webdav.Resource" is
called.
It uses a "content_type" and "get_size" attribute/method
to set the "Content-Type" and "Content-Length" HTTP header.
If there is no "content_type" attribute/method, the
content type is guessed (via "mimetypes.guess_type").
If there is no "get_size", the "Content-Length" is 0.


Dieter

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to