Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: disable failing test "should be able to remove headers" #4152

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

JoelEinbinder
Copy link
Contributor

I'm not sure if the test or the behavior is wrong, but this is failing consistently on all of the bots/locally. @yury-s you touched it last, ptal.

@JoelEinbinder
Copy link
Contributor Author

Or maybe this is fine, and the test should be rewritten like:

// @see https://github.com/GoogleChrome/puppeteer/issues/4743
it('should be able to remove headers', async ({page, server, browserName}) => {
  await page.route('**/*', route => {
    const headers = Object.assign({}, route.request().headers(), {
      foo: 'bar',
      accept: undefined, // remove "accept" header
    });
    route.continue({ headers });
  });

  const [serverRequest] = await Promise.all([
    server.waitForRequest('/empty.html'),
    page.goto(server.PREFIX + '/empty.html')
  ]);

  expect(serverRequest.headers.accept).toBe(browserName === 'webkit' ? '*/*' : undefined);
});

It looks like */* should be equivalent to an empty accept header, but I'm not familiar with how this all works.

@mxschmitt
Copy link
Member

Maybe its better to use e.g. Fetch there and use a custom request header instead of accept which has edge cases in WebKit.

Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

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

Seems like a bug in WebKit. As for the test I'll rewrite it using fetch as Max suggests.

@yury-s yury-s merged commit 7e6f2af into microsoft:master Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants