mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Add setValue calls in doClone to properly initialize Ref with tee'd streams
Addresses CodeRabbit review comment: doClone must call setValue on both the original and cloned Request's Locked.readable Ref after setting the GC cache, mirroring the constructor pattern. This ensures the Ref is properly initialized with the tee'd stream value, making the body stream accessible via the owner-aware get() path.
This commit is contained in:
@@ -828,10 +828,12 @@ pub fn doClone(
|
||||
if (js_wrapper != .zero) {
|
||||
if (this.body.value == .Locked and readable_stream_tee[0] != .zero) {
|
||||
js.gc.body.set(this_value, globalThis, readable_stream_tee[0]);
|
||||
this.body.value.Locked.readable.setValue(.{ .Request = this_value }, readable_stream_tee[0], globalThis);
|
||||
}
|
||||
|
||||
if (cloned.body.value == .Locked and readable_stream_tee[1] != .zero) {
|
||||
js.gc.body.set(js_wrapper, globalThis, readable_stream_tee[1]);
|
||||
cloned.body.value.Locked.readable.setValue(.{ .Request = js_wrapper }, readable_stream_tee[1], globalThis);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user