Skip to content

[Regression]: Response.formData() throws TypeError in WebKit 26.4 (Playwright 1.59) #40244

@ritz078

Description

@ritz078

Version

1.59.1

Steps to reproduce

  1. Clone the repo: https://github.com/ritz078/pw-webkit-formdata-repro
  2. npm install
  3. npx playwright install
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions