You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Access requested subprotocols when mocking websocket requests #40376
An example use of the Sec-WebSocket-Protocol header is in GraphQL clients, where the header is set to strings like graphql-ws (legacy) or graphql-transport-ws (modern standard).
Another example use in Zero, where initial query information is included in the Sec-WebSocket-Protocol header as an optimization to avoid an extra round trip.
When mocking APIs like this, it's necessary to have access to the value of this header to mock appropriately.
This is related to #7494, which was closed due to inactivity. The feature request there was to expose all headers, but that isn't feasible given that JS code can only set Sec-WebSocket-Protocol (the rest is automatically set by browser), and Playwright's mock affects the JS entry point.
Activity