fix(routing): match ws(s) baseURL rewrite case-insensitively by chatman-media · Pull Request #41557 · microsoft/playwright · GitHub
Skip to content

fix(routing): match ws(s) baseURL rewrite case-insensitively - #41557

Merged
Simon Knott (Skn0tt) merged 1 commit into
microsoft:mainfrom
chatman-media:fix-ws-baseurl-case
Jul 1, 2026
Merged

Simon Knott (Skn0tt) merged 1 commit into
microsoft:mainfrom
chatman-media:fix-ws-baseurl-case

Conversation

@chatman-media

Copy link
Copy Markdown
Contributor

toWebSocketBaseUrl only rewrote an http(s) baseURL to ws(s) when the scheme happened to be lowercase, so something like baseURL: 'HTTP://x.com' was left as-is and routeWebSocket() / waitForEvent('websocket') would just never match. URI schemes are case-insensitive per RFC 3986, and the rest of urlMatch.ts already treats them that way (see the origin handling a few lines down), so this just brings the ws(s) rewrite in line with that. Added a test with an uppercase HTTP:// baseURL that fails on main and passes with the fix.

toWebSocketBaseUrl() only rewrote http(s) to ws(s) when the scheme was
lowercase, so a baseURL like 'HTTP://x.com' was left untouched and
routeWebSocket()/waitForEvent('websocket') would never match. Schemes
are case-insensitive per RFC 3986, and the rest of urlMatch.ts already
treats them that way, so do the same here.
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

4 flaky ⚠️ [chromium-library] › library/chromium/oopif.spec.ts:282 › should click `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/har-websocket.spec.ts:235 › should attach websocket messages `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:337 › screencast › should work for popups `@realtime-time-library-chromium-linux`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node20`

49225 passed, 1163 skipped


Merge workflow run.

@pavelfeldman

Copy link
Copy Markdown
Member

@microsoft-github-policy-service rerun

@chatman-media

Copy link
Copy Markdown
Contributor Author

@Skn0tt
Simon Knott (Skn0tt) merged commit 25e41a6 into microsoft:main Jul 1, 2026
44 of 48 checks passed
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