diff --git a/source b/source index 4a5582ce8cb..51876d6d3a2 100644 --- a/source +++ b/source @@ -2296,7 +2296,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
multipart/form-data chunk serializerRequestCredentials enumerationmultipart/form-dataLet body be the result of running the multipart/form-data encoding algorithm with entry list
+
Let (boundary, chunks) be the result of running the multipart/form-data chunk serializer with entry list
and encoding.
Let mimeType be the isomorphic
- encoding of the concatenation of "multipart/form-data; boundary=" and the multipart/form-data boundary string generated by the multipart/form-data encoding algorithm.
Let body be the concatenation of chunks, with each
+ File object in chunks replaced by the bytes it represents.
Let mimeType be `multipart/form-data; boundary=`,
+ followed by boundary.
text/plainThe multipart/form-data encoding algorithm, given an entry
- list entry list and an encoding encoding, is as
- follows:
For each entry of entry list:
- -Replace every occurrence of U+000D (CR) not followed by U+000A (LF), and every - occurrence of U+000A (LF) not preceded by U+000D (CR), in entry's name, by a string consisting of a U+000D (CR) and U+000A (LF).
If entry's value is not a
- File object, then replace every occurrence of U+000D (CR) not followed by U+000A
- (LF), and every occurrence of U+000A (LF) not preceded by U+000D (CR), in entry's
- value, by a string consisting of a U+000D (CR) and
- U+000A (LF).
Return the byte sequence resulting from encoding the entry list using the rules
- described by RFC 7578, Returning Values from Forms: multipart/form-data, given the following conditions:
- RFC7578
Each entry in entry list is a field, - the name of the entry is the field name and the - value of the entry is the field value.
The order of parts must be the same as the order of fields in entry list. - Multiple entries with the same name must be treated as distinct fields.
Field names, field values for non-file fields, and filenames for file fields, in the
- generated multipart/form-data resource must be set to the result of encoding the corresponding entry's name or value with
- encoding, converted to a byte sequence.
For field names and filenames for file fields, the result of the encoding in the
- previous bullet point must be escaped by replacing any 0x0A (LF) bytes with the byte sequence
- `%0A`, 0x0D (CR) with `%0D` and 0x22 (") with
- `%22`. The user agent must not perform any other escapes.
The parts of the generated multipart/form-data resource that correspond to
- non-file fields must not have a `Content-Type` header specified.
The boundary used by the user agent in generating the return value of this algorithm is
- the multipart/form-data boundary string. (This value is used to
- generate the MIME type of the form submission payload generated by this algorithm.)
For details on how to interpret multipart/form-data payloads, see RFC 7578.
- RFC7578
See Fetch for details on
+ multipart/form-data. FETCH