mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: data corruption in protocol.handle (#41932)
* 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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user