Skip to content

[BUG] Wrong Accept-Language sent with Firefox and WebKit #23732

Open
@lazka

Description

@lazka

System info

  • Playwright Version: 1.32.3
  • Operating System: Ubuntu 23.04
  • Browser: Firefox
  • Other info:

Source code

  • I provided exact source code that allows reproducing the issue locally.

Config file

// playwright.config.js
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'chromium',
      use: {
        ...devices['Desktop Chrome'],
      },
    },
    {
      name: 'firefox',
      use: {
        ...devices['Desktop Firefox'],
      },
    },
  ],
});

Test file (self-contained)

import { test } from '@playwright/test';

test.use({
  locale: 'en-GB',
});

test('test-send-with-Accept-Language', async ({ page }) => {
  await page.evaluate(async () => {
    await fetch(
      "https://api.github.com/rate_limit", {
        headers: {
            'Content-Type': 'application/json',
            'Accept-Language': 'de'
        },
      });
  });
});

Steps

  • Run the test with Chromium
  • Look at the web dev tools network tab and check the request headers
  • See that Accept-Language=de is sent
  • Run the test with Firefox
  • Look at the web dev tools network tab and check the request headers

Expected

  • The request is sent with the Accept-Language=de header, same as with Chromium

Actual

  • The request is sent with the Accept-Language=en-GB header instead

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions