Re: broken zope.publisher because of new content types in zope.contenttype

Martijn Faassen <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hey,

Roger wrote:

> 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

We don't seem to be getting test failures anywhere in the ZTK. Could you 
propose a test that identifies this issue?

Aaron, can you give feedback about this issue?

Regards,

Martijn



_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.