Skip to content

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

Description

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://github.com/@api/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

Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions