Skip to content

[BUG] [Chromium/WebKit] Request object does not contain postData for file/blob #6479

Open

Description

Context:

System:

  • OS: Windows 10 10.0.19043

Binaries:

  • Node: 12.13.1 - C:\Program Files\nodejs\node.EXE
  • Yarn: 1.19.1 - ~\AppData\Roaming\npm\yarn.CMD
  • npm: 6.14.2 - C:\Program Files\nodejs\npm.CMD

Languages:

  • Bash: 4.4.20 - C:\WINDOWS\system32\bash.EXE

npmPackages:

  • playwright: ^1.10.0 => 1.10.0 / tip-of-tree

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and
that we can run and debug locally. For example:

const playwright = require('.');

(async () => {
  const browser = await playwright.webkit.launch();
  const page = await browser.newPage();

  await page.goto('http://example.com');

  const requestPromise = page.waitForRequest(() => true);
  const [request] = await Promise.all([
    page.waitForRequest("**/*"),
    page.evaluate(() => {
      var file = new File(['file-contents'], 'filename.txt');

      fetch('/data', {
        method: 'POST',
        headers: {
          'content-type': 'application/octet-stream'
        },
        body: file
      });
    })
  ])
  console.info('request.method()', request.method());
  console.info('request.url()', request.url());
  console.info('request.headers()', request.headers());
  console.info('request.postData()', request.postData());
})();

Describe the bug

the request.postData() contains null in Chromium and WebKit. In Firefox it's filled.

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

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions