[whatwg/fetch] FormData content-type doesn't match form submission behavior in browsers (#422)

The FormData case in https://fetch.spec.whatwg.org/#concept-bodyinit-extract says:

> Set Content-Type to `'multipart/form-data;boundary='` ...

This doesn't match how form submission works in browsers.  Testcase:

    <form action="http://software.hixie.ch/utilities/cgi/test-tools/echo"
          enctype="multipart/form-data" method="POST">
      <input name="a" value="b">
      <input name="c" type="submit">
    </form>

When I submit that in Firefox, Chrome, Safari, and Edge, they all send:

    Content-Type: multipart/form-data; boundary=stuff

which differs from what the fetch spec says to do for FormData by having an ASCII space after the ';'.  It would probably be better to align behavior here so HTML form submission can actually be modeled in terms of a Request constructed from a FormData...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/422

Received on Thursday, 24 November 2016 22:43:31 UTC