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 #33

Closed
annevk opened this issue Jul 10, 2017 · 10 comments · Fixed by #427
Closed

MIME type parsing #33

annevk opened this issue Jul 10, 2017 · 10 comments · Fixed by #427

Comments

@annevk
Copy link
Contributor

annevk commented Jul 10, 2017

See http://www.rfc-editor.org/errata_search.php?rfc=7231&eid=4031 (rejected due to scope). Clients typically (or all?) allow text/html; despite it being invalid.

@annevk
Copy link
Contributor Author

annevk commented Oct 4, 2017

One of the things that I couldn't find addressed anywhere is something like text/html;charset=gbk;charset=utf-8. The introduction of https://tools.ietf.org/html/rfc2046 mentions parameters as a set, thereby potentially outlawing duplicate names, but there's nothing normative to that effect anywhere. (Browsers are evenly split on how they handle this case by the way.)

@mnot
Copy link
Member

mnot commented Apr 20, 2018

See also whatwg/mimesniff#30 e.g., discussion of multiple content-types. This has potential security impact.

@annevk
Copy link
Contributor Author

annevk commented Apr 20, 2018

For MIME types I ended up (re)writing https://mimesniff.spec.whatwg.org/#understanding-mime-types btw and also have a bunch of tests at https://github.com/w3c/web-platform-tests/tree/master/mimesniff/mime-types.

@mnot mnot added the semantics label Jun 29, 2018
@mnot
Copy link
Member

mnot commented Feb 2, 2020

Discussed in Basel; inclination is to change the ABNF, and survey similar places to align if necessary.

@snuggs
Copy link

snuggs commented Feb 10, 2020

@mnot pardon my ignorance but what is ABNF? Am I wrong to assume it is this ?

Thanks in advance!

@mnot
Copy link
Member

mnot commented Feb 10, 2020

It is.

@mnot
Copy link
Member

mnot commented Jul 2, 2020

Note that this is about the trailing semicolon, at least initially.

@mnot
Copy link
Member

mnot commented Jul 30, 2020

Discussed on editors' call; we should create a new ABNF rule parameters in 5.4.1.4. Parameters that allows semicolons without following parameter, and use that where appropriate.

@reschke
Copy link
Contributor

reschke commented Jul 31, 2020

Just to check (grep in httpbis.abnf):

expectation = token [ "=" ( token / quoted-string ) *parameter ]

media-range = ( "*/*" / ( type "/*" ) / ( type "/" subtype ) ) *( OWS ";" OWS parameter )
media-type = type "/" subtype *( OWS ";" OWS parameter )

parameter = parameter-name "=" parameter-value
parameter-name = token
parameter-value = ( token / quoted-string )

transfer-coding = token *( OWS ";" OWS transfer-parameter )
transfer-parameter = token BWS "=" BWS ( token / quoted-string )

So "expectation" needs a fix (see #420). So "Expect" would be the only affected field in addition to "Content-Type". (Because "TE" is special). Are we ok with that?

That said, do we want:

parameters = *( OWS ";" OWS [ parameter ] )

or

parameters = *( OWS ";" OWS parameter ) [ OWS ";" OWS ]

?

@reschke
Copy link
Contributor

reschke commented Aug 5, 2020

See #427 (comment)

@reschke reschke reopened this Aug 5, 2020
reschke added a commit that referenced this issue Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

5 participants