8 Jun
2000
8 Jun
'00
7:47 p.m.
Brian Lloyd writes:
What if we change this to:
if a 'content_type' attribute exists, it is used
else if the object's id seems to have a file extension (. in the id), try to use guess_content_type
else if there is a 'default_content_type' attribute, use that
else fall back to the hated application/octet-stream (or, I've seen x-unknown-content-type used before, but I don't know if this is really any better).
Then we could put a 'default_content_type' attribute in the class of dtml documents and methods, which would take care of the most common case. Thoughts?
Sounds pretty good. Setting 'default_content_type' can then be another item in the unwritten Guide to Writing a Zope Product.