[Zope] Wrong mime type sent by Zope on every page

Brian Lloyd Brian@digicool.com
Thu, 8 Jun 2000 16:24:05 -0400


> > But what if there are side effects to calling the document? 
> What should
> > happen? I don't want a counter to go up or anything just 
> because a HEAD was
> > called on the object.
> > 
> > This is not as black-and-white and simple an issue.
> 
> The web is an imperfect medium, but returning a junk content 
> type isn't
> good.

I'll throw out a proposal on this. It also is not perfect, but 
seems to strike a happier balance. When HEAD is called on an 
object, what currently happens is:

  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 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).


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?

Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com