1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/cli/tests
Andreu Botella 9ba2c4c42f
fix(fetch): Correctly decode multipart/form-data names and filenames (#19145)
Currently the `multipart/form-data` parser in
`Request.prototype.formData` and `Response.prototype.formData` decodes
non-ASCII filenames incorrectly, as if they were encoded in Latin-1
rather than UTF-8. This happens because the header section of each
`multipart/form-data` entry is decoded as Latin-1 in order to be parsed
with `Headers`, which only allows `ByteString`s, but the names and
filenames are never decoded correctly. This PR fixes this as a
post-processing step.

Note that the `multipart/form-data` parsing for this APIs in the Fetch
spec is very much underspecified, and it does not specify that names and
filenames must be decoded as UTF-8. However, it does require that the
bodies of non-`File` entries are decoded as UTF-8, and in browsers,
names and filenames always use the same encoding as the body.

Closes #19142.
2023-05-16 17:49:35 +02:00
..
integration docs: fix typos (#19118) 2023-05-16 14:30:16 +02:00
node_compat feat(node/crypto): Builtin Diffie-Hellman Groups (#19137) 2023-05-16 00:07:58 +02:00
testdata fix(dts): move BroadcastChannel type to lib.deno.unstable.d.ts (#19108) 2023-05-14 20:27:14 +09:00
unit fix(fetch): Correctly decode multipart/form-data names and filenames (#19145) 2023-05-16 17:49:35 +02:00
unit_node chore: fix & update node compat config (#19106) 2023-05-13 14:49:11 +09:00
integration_tests.rs tests: move integration tests to a single module (#17380) 2023-01-13 02:59:13 +01:00