fix(routing): match ws(s) baseURL rewrite case-insensitively#41557
Conversation
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.
Test results for "MCP"4 failed 7457 passed, 1132 skipped Merge workflow run. |
Test results for "tests 1"4 flaky49225 passed, 1163 skipped Merge workflow run. |
|
@microsoft-github-policy-service rerun |
@microsoft-github-policy-service agree |
toWebSocketBaseUrlonly rewrote an http(s)baseURLto ws(s) when the scheme happened to be lowercase, so something likebaseURL: 'HTTP://x.com'was left as-is androuteWebSocket()/waitForEvent('websocket')would just never match. URI schemes are case-insensitive per RFC 3986, and the rest ofurlMatch.tsalready 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 uppercaseHTTP://baseURL that fails on main and passes with the fix.