[Zope-dev] MIME type syntax (was: Bug in zc.resourcelibrary?)

Christian Theune ct at gocept.com
Wed Dec 5 04:59:36 EST 2007


Am Mittwoch, den 05.12.2007, 10:20 +0100 schrieb Thomas Lotze:
> Fred Drake wrote:
> 
> > On Dec 4, 2007 5:55 PM, Thomas Lotze <thomas at thomas-lotze.de> wrote:
> >> It wasn't even about whitespace around the / but leading whitespace in
> >> front of the major type.
> > 
> > Wow.  It probably didn't occur to me that would be screwed up.
> 
> I've now looked up RfC 2045 which states that there is to be no whitespace
> within the MIME type specification, i.e. in particular none around the
> slash. This requires a change to zope.publisher.contenttype. OTOH it's
> probably up to us how to treat whitespace surrounding the string
> specifying MIME type:
> 
> - Either we decide that such a string should always follow the RfC exactly
> and contain no whitespace at all (which makes the way zope.publisher.http
> handles it the correct way),
> 
> - or we allow for it to be some possibly whitespace-padded string that
> contains a valid MIME spec, which would allow for surrounding whitespace,
> but not space around the slash.
> 
> I'd prefer the first option for clarity. Is there any reason to be
> forgiving regarding whitespace in the first place?

That depends on the container format and therefore it's the
responsibility of the container (e.g. a HTTP header) to remove the
whitespace.

Note that AFAICT RFC 2045 section 5.1 (that's what you're referring to
AFAICT) defines the MIME type specification as done with the
Content-Type header for MIME messages without defining exactly how the
actual type relates to the container.

IMHO we should not pay attention to whitespace.

Christian

-- 
gocept gmbh & co. kg - forsterstrasse 29 - 06112 halle (saale) - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20071205/b54ec0b5/attachment.bin


More information about the Zope-Dev mailing list