Version
1.59.1
Steps to reproduce
- Clone the repo: https://github.com/ritz078/pw-webkit-formdata-repro
npm install
npx playwright install
npx playwright test
The test constructs a trivial multipart/form-data Response and calls .formData() on it:
const boundary = '----WebKitFormBoundary1234';
const body = [
`--${boundary}`,
'Content-Disposition: form-data; name="field1"',
'',
'value1',
`--${boundary}`,
'Content-Disposition: form-data; name="file1"; filename="test.png"',
'Content-Type: image/png',
'',
'PNG_BINARY_DATA',
`--${boundary}--`,
].join('\r\n');
const response = new Response(body, {
headers: { 'Content-Type': `multipart/form-data; boundary=${boundary}` },
});
const fd = await response.formData(); // TypeError: Type error (WebKit only)
Expected behavior
Response.formData() should parse the multipart body and return a FormData object with the expected keys, as it does on Chromium and Firefox.
Actual behavior
On WebKit, Response.formData() throws TypeError: Type error for any multipart/form-data response — even trivially simple ones.
✓ [chromium] › Response.formData() works with multipart/form-data
✘ [webkit] › Response.formData() works with multipart/form-data
✓ [firefox] › Response.formData() works with multipart/form-data
Error: TypeError: Type error
Additional context
- Regression: This works in Playwright 1.58.0 (WebKit 26.0) but fails in 1.59.0 (WebKit 26.4).
- The native
FormData constructor and new Request(...).formData() are unaffected — only Response.formData() is broken.
- This affects any application that uses
fetch() and then calls .formData() on the response to parse multipart data from a server.
Version
1.59.1
Steps to reproduce
npm installnpx playwright installnpx playwright testThe test constructs a trivial
multipart/form-dataResponseand calls.formData()on it:Expected behavior
Response.formData()should parse the multipart body and return aFormDataobject with the expected keys, as it does on Chromium and Firefox.Actual behavior
On WebKit,
Response.formData()throwsTypeError: Type errorfor any multipart/form-data response — even trivially simple ones.Additional context
FormDataconstructor andnew Request(...).formData()are unaffected — onlyResponse.formData()is broken.fetch()and then calls.formData()on the response to parse multipart data from a server.