Doubtful sentence in of the latest OPC draft

MURATA Makoto eb2m-mrt at
Thu Sep 13 15:50:08 CEST 2018

Here is the doubtful sentence in of the current
OPC draft:

The comparison might be case-sensitive and
include every character regardless of the role
it plays in the content-type grammar of RFC
7231, or it might follow the grammar of RFC

1) sensitive or insensitive?

I find that media types in .Net are case insensitive.
I executed the following F# code and the result is
"case insensitive".

    let mt1 =
    let mt2 =

    if mt1 = mt2 then
        printfn "case insensitive"
    else printfn "case senstive"

How harmful if an OPC implementation does not handle content types in
a case-sensitive manner?  If programmers specify "Application/Xml" and
an OPC package has the following Override element, programmers
will get an unexpected result.

   <Override PartName="/a.xml" ContentType="application/xml" />

But do such an OPC implementation create problematic OPC packages?
Suppose that an OPC package aleady contains:

   <Default Extension="xml" ContentType="application/xml" />

If a programmer would like to add another part /a.xml of
"Application/Xml", a package will have

   <Override PartName="/a.xml" ContentType="Application/Xml" />

Although this Override element is unnecessary, it is not extremely
harmful.  Correct OPC implementations will have no problems even
if they encounter such unnecessary Override elements.

I propose to disallow case-sensitive comparison of media types
but add a note.

Note: The previous edition of this document did not disallow
case-sensitive comparison.

2) the content-type grammar of RFC 7231

I am puzzled by the doubtful sentence quoted above.
First, the synax in RFC 7231 is shown below:


     media-type = type "/" subtype *( OWS ";" OWS parameter )
     type       = token
     subtype    = token
     parameter  = token "=" ( token / quoted-string )


     text/html; charset="utf-8"

What does the sentence mean?


This message has been scanned for malware by Forcepoint.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the sc34wg4 mailing list