[Zope-dev] broken zope.publisher because of new content types in zope.contenttype

Roger dev at projekt01.ch
Sat Jan 2 05:17:45 EST 2010


Hi all

Since aaron added new mimetypes e.g. application/javascript,
the _implicitResult method in zope.publisher.http.py (line 794)
is broken because the method checks for text/* content types
if unicode is given:

    def _implicitResult(self, body):
        encoding = getCharsetUsingRequest(self._request) or 'utf-8'
        content_type = self.getHeader('content-type')

        if isinstance(body, unicode):
            try:
                if not content_type.startswith('text/'):
                    raise ValueError(
                        'Unicode results must have a text content type.')
            except AttributeError:
                    raise ValueError(
                        'Unicode results must have a text content type.')

Sould we remove this basic content type check above?
Or enhance the check with the new added unicode valid
content types like application/javascript.

btw, the RFC is just Informational which defines
this changes. See: http://www.rfc-editor.org/rfc/rfc4329.txt


Regards
Roger Ineichen
_____________________________
END OF MESSAGE



More information about the Zope-Dev mailing list