mime icon indicating copy to clipboard operation
mime copied to clipboard

parsing quoted parameters conflicts with RFC 2045

Open kanekv opened this issue 5 years ago • 0 comments

https://github.com/hyperium/mime/blob/2e0268e6dc2933db308e452787c4ca85bc63bd6e/mime-parse/src/rfc7231.rs#L400

let mime = parse("text/plain; charset=\"utf-8\"").unwrap();

Parsing quoted parameters directly contradicts with RFC 2045:

Note that the value of a quoted string parameter does not include the
   quotes.  That is, the quotation marks in a quoted-string are not a
   part of the value of the parameter, but are merely used to delimit
   that parameter value.  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.

Am I reading it incorrectly?

kanekv avatar May 28 '19 04:05 kanekv