Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsing quoted parameters conflicts with RFC 2045 #112

Open
kanekv opened this issue May 28, 2019 · 0 comments
Open

parsing quoted parameters conflicts with RFC 2045 #112

kanekv opened this issue May 28, 2019 · 0 comments

Comments

@kanekv
Copy link

kanekv commented May 28, 2019

assert_eq!(mime.param("charset"), Some("\"utf-8\""));

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant