chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Guillaume ...@nuxeo.com>
Subject Media type syntax
Date Mon, 16 Nov 2009 17:06:44 GMT
The relevant spec is MIME, RFC 2045, which defines media types.
The format is defined in 5.1 (Syntax of the Content-Type Header
Field), and basically you have to be quite lenient in parsing, for
instance the spec says:

   In addition, comments are allowed in
   accordance with RFC 822 rules for structured header fields.  Thus the
   following two forms
     Content-type: text/plain; charset=us-ascii (Plain text)
     Content-type: text/plain; charset="us-ascii"
   are completely equivalent.

And given the BNF I'd say that this is also equivalent:
     Content-type:  text/plain;     CharSet=  "us-ascii"

And given all the complex rules w.r.t comments in RFC 822 this also
has to be equivalent:
     Content-type:  text/plain(hello);     CHARSET(world)=((yes
nesting)) us-ascii

Ok the comment stuff is pretty silly, but the parameter name case
insensitivity, optional double quotes and spaces is important.

Florent



On Wed, Nov 4, 2009 at 6:48 PM, Shane Johnson <sjohnson@citytechinc.com> wrote:
> That is good to know. I can definitely fix that. Although...
>
> I'd like file a formal complaint on this whole spaces or not thing ;)
>
> Shane
>
> On Wed, Nov 4, 2009 at 11:43 AM, Florent Guillaume <fg@nuxeo.com> wrote:
>
>> On Wed, Nov 4, 2009 at 6:26 PM, Shane Johnson <sjohnson@citytechinc.com>
>> wrote:
>> > <link href="http://localhost:8080/cmis/children/1" rel="down"
>> > type="application/atom+xml; type=feed" />
>> >
>> > It looks like there is a space in the type. Not sure if this is because
>> of
>> > the email or not. However, I'm doing an comparison of
>> > 'application/atom+xml;type=feed' which has no spaces. Perhaps that is it?
>>
>> Yes, both are legal and equivalent. I forget the RFC that defines that
>> but arbitrary spaces are definitely allowed.
>>
>> Funny, at the last face-to-face meeting of the CMIS TC we had interop
>> tests and I seem to remember that someone had this very same problem
>> of being too strict on content type parsing :)
>>
>> Florent
>>
>> >
>> > Also, I don't want to flood the Chemistry list if this is an issue with
>> CMIS
>> > Explorer.  If it is, we can continue this on the Google Group for it. I
>> just
>> > saw your post there. Sorry I missed it earlier.
>> >
>> > Shane
>> >
>>
>> --
>> Florent Guillaume, Head of R&D, Nuxeo
>> Open Source, Java EE based, Enterprise Content Management (ECM)
>> http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87
>>
>



-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

Mime
View raw message