mswjs / interceptors

Low-level network interception library.
https://npm.im/@mswjs/interceptors
MIT License
539 stars 123 forks source link

WebSocket: Outgoing client events have the wrong "currentTarget" #524

Closed kettanaito closed 6 months ago

kettanaito commented 6 months ago

Outgoing client events must have the correct srcElement and currentTarget properties set to the WebSocketOverride instance.

Current behavior

Screenshot 2024-03-20 at 13 01 58

Expected behavior

This is a screenshot of the incoming event but the idea is the same.

Screenshot 2024-03-20 at 13 02 48

kettanaito commented 6 months ago

Confirming that in the case of WebSocket events, both target and currentTarget point to the WebSocket client instance:

Screenshot 2024-03-27 at 10 45 53
kettanaito commented 6 months ago

Released: v0.26.14 🎉

This has been released in v0.26.14!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.