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

[Bug]: Chromium browsers does not respect locale option (no use of Accept-Language header) for WebSocket connections #30568

Closed
apinnau opened this issue Apr 26, 2024 · 2 comments

Comments

@apinnau
Copy link

apinnau commented Apr 26, 2024

Version

1.43.0

Steps to reproduce

  1. Clone my repo at https://github.com/apinnau/playwright-dotnet-chromium-issue-with-websockets/tree/main
  2. To run E2E test cases follow instructions on README.md
  3. 1 of 4 test cases will fail and shows the defect (missing Accept-Language header while switch from HTTP to websocket connection between client and server)

Expected behavior

  • Chromium and Firefox are respecting the localized context during whole test run
    • on first load of website via HTTP request
    • on later performed switch from HTTP to websocket (GET request with Upgrade: websocket header)
  • Website is loaded with correct language via HTTP and websocket
  • All 4 E2E test cases passes

Actual behavior

  • Firefox:
    • The two test cases with Firefox passes as expected (Accept-Language header is respected all the time)
  • Chromium:
    • Chromium respects the localized context as the Accept-Language header is sent while website is loaded via HTTP
    • Chromium DOES NOT respect the localized context as the Accept-Language header is missing when Blazor application requests the switch to websocket (GET request with Upgrade: websocket header)
    • One test case with Chromium still passes (as English is requested and English is default language > so missing Accept-Language header doesn't influence the test result)
    • Second test case with Chromium fails where German is requested via Accept-Language header:
      • Website is first loaded in German via HTTP
      • After a short time website switches to websocket and is loaded again with English as default language

Additional context

Environment

- Operating System: [Windows 11 (10.0.22631)] or [Ubuntu 22.04 via WSL]
- CPU: [x86]
- Browser: [Chromium > failing, Firefox > passing, Chrome > passing]
- .NET Version: [net8.0] [Blazor server-side rendering]
- Playwright .NET: 1.43.0
@mxschmitt mxschmitt transferred this issue from microsoft/playwright-dotnet Apr 26, 2024
@mxschmitt
Copy link
Member

Folding into #13919 - looks like the same.

@apinnau
Copy link
Author

apinnau commented May 1, 2024

@mxschmitt: Is the implementation of the browser (Chromium, Firefox etc.) the same for Playwright Node.js and .NET?
As #13919 is open for 2 years now - do you see any chance that this will be fixed?

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

No branches or pull requests

3 participants