RE: [Zope] Wrong mime type sent by Zope on every page
-----Original Message----- From: Dan L. Pierson [mailto:dan@sol.control.com] Sent: Thursday, June 08, 2000 3:47 PM To: Brian Lloyd Cc: 'Chris Withers'; Martijn Pieters; Andrew Diller; zope@zope.org Subject: RE: [Zope] Wrong mime type sent by Zope on every page
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.
That's right - I expect that it could be useful for a few products. I can see XMLDocuments having a default of 'text/xml', but I suspect that a lot of products won't really have to care. Things that have no real similarity to conventional "pages" (like database connection objects, etc.) are probably useless to a robot that works with "pages" anyway, so they are better off sending a default non-committal response like "application/octet-stream". Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
participants (1)
-
Brian Lloyd