Skip to content

Define multipart/form-data#1922

Draft
annevk wants to merge 2 commits intomainfrom
annevk/multipart/form-data
Draft

Define multipart/form-data#1922
annevk wants to merge 2 commits intomainfrom
annevk/multipart/form-data

Conversation

@annevk
Copy link
Copy Markdown
Member

@annevk annevk commented Apr 14, 2026

Based on Andreu's work at https://github.com/andreubotella/multipart-form-data with mostly editorial changes and some corrections.

WPT coverage at fetch/api/response/response-form-data.html

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

annevk added 2 commits April 14, 2026 16:19
Based on Andreu's work at https://github.com/andreubotella/multipart-form-data with mostly editorial changes and some corrections.

WPT coverage at fetch/api/response/response-form-data.html
Comment thread fetch.bs
<p>To <dfn export for="multipart/form-data/boundary">generate</dfn> a
<a for="multipart/form-data" lt="boundary"><code>multipart/form-data</code> boundary</a>, return an
<a>implementation-defined</a> <a for=/>byte sequence</a> which fulfills the conditions for
boundaries, such that part of it is randomly generated, with a minimum entropy of 95 bits.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was based on my analysis which IIRC concluded that Chromium/WebKit's boundary had exactly 95 bits of entropy, and that Gecko's was probably close to but less than 96 bits. But I see that at least Gecko has changed its boundary string generation now, and I'm not sure where it stands.

Do we want to spec something here that aligns with current implementations, or do we want to change this to some round number that makes sense (e.g. 32 * 3 = 96 bits would be easy to implement), and make implementations match?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants