Jim Washington wrote:
> Still playing with Dojo. Very Nice! :)
> I'm having a problem with content-type for items served from a
> In particular, one piece of dojo, a file with a .html extension begins
> with <?xml version="1.0" encoding="UTF-8"?>. The DOCTYPE says XHTML 1.0
> Strict, but Zope3 returns it as text/plain (X-Content-Type-Warning:
> guessed from content).
> Unfortunately, that is a problem, because the client looks at
> content-type to decide how to parse.
> If I set the content-type to text/html, it works OK.
> So, is this a Dojo bug or a Zope3 bug?
Hearing none, the answer is:
Purely static files can be served just fine through zope.paste. No need
to bother Zope 3 at all to do this.
1. install zope.paste, Paste, PasteDeploy
2. in the [Zope3 instance]/etc folder, paste.ini can look like (this
somewhat complicated example uses my gzipper as a middleware filter):
use = egg:Paste#urlmap
/ = zope3
/@@/dojo = dojo
pipeline = gzipper main
paste.app_factory = zope.paste.application:zope_publisher_app_factory
filter-with = gzipper
nocompress=jp gz zip
Something similar should work for any static or third-party content.
Maybe a /static/images directory? This may be old hat to some, but I
thought I would share.
A small but important caveat: Paste.urlmap (0.9) does not seem to like
:port in urls at the moment, so no http://localhost:8180 for now. Zope3
can be listening at 8180, but you need a non-port alias for everything
to work properly. Of course, it is possible I have a local
misconfiguration somewhere that makes this break.
Zope3-dev mailing list