mswjs / interceptors

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

fix: Fix issue with reused send buffer #680

Open freehuntx opened 2 days ago

freehuntx commented 2 days ago

Sometimes games or websites reuse the buffer they send.
Especially game engines use this for performance reasons. This causes our mock to get already overwritten bytes which were not sent like this.

To fix this we should make a copy of the buffer as soon as possible.

Ps: Im not deep in this library, if there is an even earlier place to do the copy, we should move this.