According to RFC 2046, the BNF of the form data body is:
multipart-body := [preamble CRLF]
dash-boundary transport-padding CRLF
body-part *encapsulation
close-delimiter transport-padding
[CRLF epilogue]
Where "epilogue" is any text that "may be ignored or discarded". So we
should stop parsing the body once we encounter the terminating delimiter
("--").
Note that our parsing function is from an attempt to standardize the
grammar in the spec: https://andreubotella.github.io/multipart-form-data
This proposal hasn't been updated in ~4 years, and the fetch spec still
does not have a formal definition of the body string.
|
||
|---|---|---|
| .. | ||
| fetch-controller-abort-with-body-does-not-crash-with-timeout.txt | ||
| fetch-controller-abort.txt | ||
| fetch-headers-non-ascii.txt | ||
| fetch-request-url-search-params.txt | ||
| fetch-response-content-type.txt | ||
| fetch-response-url-encoded.txt | ||
| fetch-timed-out-request.txt | ||
| multipart-form-data-crlf.txt | ||
| request-constructor-does-not-throw-on-null-body-with-get-or-head-request.txt | ||