feat(route): expose WebSocket subprotocols on WebSocketRoute#40377
feat(route): expose WebSocket subprotocols on WebSocketRoute#40377dgozman merged 1 commit intomicrosoft:mainfrom
Conversation
|
@microsoft-github-policy-service agree |
|
|
||
| Returns an empty array if no protocols were specified. | ||
|
|
||
| **Usage** |
There was a problem hiding this comment.
Wasn't sure if this should go here or at the top, doesn't look like the other methods have usage examples inline.
Adds `WebSocketRoute.protocols(): string[]` so route handlers can read the subprotocols the page passed to `new WebSocket(url, protocols)`. This corresponds to the `Sec-WebSocket-Protocol` request header, which is the only handshake header value page-side JS actually originates.
e2d14c6 to
0b43b80
Compare
Test results for "MCP"4 failed 6581 passed, 916 skipped Merge workflow run. |
Test results for "tests 1"14 flaky41317 passed, 847 skipped Merge workflow run. |
dgozman
left a comment
There was a problem hiding this comment.
This looks great, thank you for the PR!
|
Thanks for the quick merge @dgozman! |
Fixes #40376
Adds
WebSocketRoute.protocols(): string[]so route handlers can read the subprotocols the page passed tonew WebSocket(url, protocols). This corresponds to theSec-WebSocket-Protocolrequest header, which is the only handshake header value page-side JS actually sets.