1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/ext/fetch
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
..
20_headers.js refactor(core): Use ObjectHasOwn instead of ObjectPrototypeHasOwnProperty (#18952) 2023-05-02 12:15:45 +02:00
21_formdata.js fix(fetch): Correctly decode multipart/form-data names and filenames (#19145) 2023-05-16 17:49:35 +02:00
22_body.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
22_http_client.js refactor: Use ES modules for internal runtime code (#17648) 2023-02-07 20:22:46 +01:00
23_request.js fix(core): Use primordials for methods (#18839) 2023-05-01 15:30:02 +02:00
23_response.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
26_fetch.js refactor(webidl): move prefix & context out of converters options bag (#18931) 2023-05-01 10:47:13 +00:00
byte_stream.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
Cargo.toml chore: forward v1.33.3 release commit to main (#19111) 2023-05-12 14:47:27 +00:00
fs_fetch_handler.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
internal.d.ts refactor: remove remaining references to "flash" server (#18580) 2023-04-04 12:37:56 +02:00
lib.deno_fetch.d.ts fix(ext/fetch): remove Response.trailer from types (#17284) 2023-01-15 04:42:52 +00:00
lib.rs perf: lazily create RootCertStore (#18938) 2023-05-01 16:42:05 -04:00
README.md Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00

deno_fetch

This crate implements the Fetch API.

Spec: https://fetch.spec.whatwg.org/