w3c / FileAPI

File API
https://w3c.github.io/FileAPI/
Other
105 stars 44 forks source link

Issues with MIME types #170

Open andreubotella opened 3 years ago

andreubotella commented 3 years ago

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:

The second point implies that on a response coming from the fetch API that for whatever reason happened to have the MIME type multipart/form-data; boundary=cadena-de-separación (notice the ó), response.formData() might succeed but response.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 actual multipart/form-data payload coming from Chromium or WebKit (since they start their boundary strings with WebKitFormBoundary), and a developer decoded it as a Blob; trying to parse that blob afterwards with new Request(blob).formData() would fail, since the boundary string seems to be parsed case-sensitively.

annevk commented 3 years ago

This is largely a duplicate of #43 I think.

andreubotella commented 3 years ago

Points 2 and 3 can be part of #43, but the first point is an unrelated editorial fix. I'll file a PR.