fix: data corruption in protocol.handle (#41933)

* fix: data corruption in protocol.handle

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* slice instead of subarray

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
trop[bot] 2024-04-23 11:23:19 -04:00 committed by GitHub
parent 8fd8757248
commit 8d69c95ee0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 1 deletions

View file

@ -18,7 +18,7 @@ function makeStreamFromPipe (pipe: any): ReadableStream {
try {
const rv = await pipe.read(buf);
if (rv > 0) {
controller.enqueue(buf.subarray(0, rv));
controller.enqueue(buf.slice(0, rv));
} else {
controller.close();
}