-
Notifications
You must be signed in to change notification settings - Fork 44
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
Issues with MIME types #170
Comments
This is largely a duplicate of #43 I think. |
Points 2 and 3 can be part of #43, but the first point is an unrelated editorial fix. I'll file a PR. |
andreubotella
pushed a commit
to andreubotella/FileAPI
that referenced
this issue
May 11, 2021
The term "parsable MIME type" used to be part of the MIME Sniffing standard, but it was removed in whatwg/mimesniff#36. This change replaces its uses with equivalent phrasing that references the "parse a MIME type" algorithm. It also replaces mentions of "ASCII-encoded strings" with the Infra standard's definition of "ASCII string". Closes w3c#170.
This was referenced May 11, 2021
jimmywarting
referenced
this issue
in nodejs/node
May 14, 2021
The `Blob` object is an immutable data buffer. This is a first step towards alignment with the `Blob` Web API. Signed-off-by: James M Snell <[email protected]> PR-URL: #36811 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As part of my work on defining the
multipart/form-data
parser, I noticed a couple things in the File API standard related to MIME types:type
attribute is defined as an ASCII string, perhaps assuming that every string that would be successfully parsed as a MIME type, as well as every serialization of a MIME type, would be ASCII strings. This is not the case, as per The values of the MIME type parameters aren't parsed as ASCII strings whatwg/mimesniff#141.type
attribute is also defined as being lowercase. And while the MIME parsing algorithm does ASCII-lowercase the MIME record's type, subtype, and parameter names, it doesn't lowercase parameter values. See enforce lowercase letter on multipart boundary whatwg/html#6251 for a case where it matters.The second point implies that on a response coming from the
fetch
API that for whatever reason happened to have the MIME typemultipart/form-data; boundary=cadena-de-separación
(notice the ó),response.formData()
might succeed butresponse.blob()
would fail, which would seem paradoxical.The third point implies that if, for whatever reason, there was a response coming from the
fetch
API which contained an actualmultipart/form-data
payload coming from Chromium or WebKit (since they start their boundary strings withWebKitFormBoundary
), and a developer decoded it as aBlob
; trying to parse that blob afterwards withnew Request(blob).formData()
would fail, since the boundary string seems to be parsed case-sensitively.The text was updated successfully, but these errors were encountered: