Re: [Zope] ZServer stepping on Content-Type and Content-Length?
29 Aug
2000
29 Aug
'00
7:37 p.m.
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
9351
Age (days ago)
9351
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dieter Maurer