[prev in list] [next in list] [prev in thread] [next in thread]
List: zope-cmf
Subject: Re: [Zope-CMF] Some views don't set the content-type
From: "Charlie Clark" <charlie.clark () clark-consulting ! eu>
Date: 2010-04-06 14:11:28
Message-ID: op.vaqu1eb95mynk9 () fuchsia ! local
[Download RAW message or body]
Am 05.04.2010, 19:17 Uhr, schrieb Tres Seaver <tseaver@palladion.com>:
> For a template, the <meta> tag should be correct, if present. No
> template cxcept for the main_template is likely ever to return that tag
> to the browser, but there is no reason we shouldn't believe it when
> loading the template as software. I wouldn't require *any* template
> outside the main_template to set the DOCTYPE: the potential for bugs in
> how ZPT (or chameleon) merge the "prefixes" of the documents is too high.
You're right, of course, that this should only affect main_template -
there can only be one content type per view. I've narrowed the CMF issue
down to ursa_globals + Firefox. Without a meta tag the content-type gets
set to "; Charset=utf-8" whereas getMainGlobals sets "text/html;
Charset=utf-8" in there.
getMainGlobals:
if not 'charset' in (context.REQUEST.RESPONSE.getHeader('content-type') or
'')
...
context.REQUEST.RESPONSE.setHeader('content-type',
'text/html; charset=%s' %
default_charset)
ursa_globals
ct = self.request.RESPONSE.getHeader('content-type') or ''
...
self.request.RESPONSE.setHeader('content-type',
'%s; charset=%s' % (ct, default_charset))
So getMainGlobals defaults to "text/html" and ursa_globals to " " for the
content type. I think ursa_globals is wrong here.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-CMF maillist - Zope-CMF@zope.org
https://mail.zope.org/mailman/listinfo/zope-cmf
See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic