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

MIME type parsing, duplicate parameters #41

Closed
annevk opened this issue Oct 13, 2017 · 5 comments
Closed

MIME type parsing, duplicate parameters #41

annevk opened this issue Oct 13, 2017 · 5 comments

Comments

@annevk
Copy link
Member

@annevk annevk commented Oct 13, 2017

I thought I had already raised this, but Content-Type: text/html;charset=gbk;charset=utf-8 results in UTF-8 in Chrome and Firefox, and GBK in Edge and Safari.

When there's duplicate headers there seems to be some preference to let the first header win; unclear what should apply here. My tendency would be to go with Edge and Safari as they have that kind of behavior and in practice it's easier to get Chrome and Firefox to align.

There's also a data model question here. Should MIME types support duplicate parameters (multimap of sorts) or is treating them as a normal map fine?

cc @bzbarsky @mcmanus @sleevi

@GPHemsley
Copy link
Member

@GPHemsley GPHemsley commented Oct 14, 2017

I agree with favoring the first one – I seem to recall that being specified somewhere. Maybe with X-Content-Type-Options?

@yutakahirano
Copy link
Member

@yutakahirano yutakahirano commented Nov 14, 2017

https://tools.ietf.org/html/rfc6838 says

Parameter names are case-insensitive and no meaning is attached to
the order in which they appear. It is an error for a specific
parameter to be specified more than once.

and some modules in Chrome (e.g., SendBeacon) handle it as not valid.

@annevk
Copy link
Member Author

@annevk annevk commented Nov 14, 2017

That RFC doesn't update or obsolete the definition of MIME types though. It's only about the registration procedure.

Is it important for SendBeacon for this to be an error? And if so, why is it not important elsewhere?

@yutakahirano
Copy link
Member

@yutakahirano yutakahirano commented Nov 14, 2017

Is it important for SendBeacon for this to be an error? And if so, why is it not important elsewhere?

Probably not. I just wanted to tell the current status.

@annevk
Copy link
Member Author

@annevk annevk commented Nov 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.