mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 04:02:52 +00:00
LibWeb: Add a 'piped through' helper method on ReadableStream
This reads a bit nicer, and follows the streams spec pattern on performing operations on a stream outside of the streams spec.
This commit is contained in:
parent
79a2b96d1c
commit
da408cb09a
Notes:
github-actions[bot]
2024-12-25 11:03:22 +00:00
Author: https://github.com/shannonbooth
Commit: da408cb09a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3029
Reviewed-by: https://github.com/kennethmyhra ✅
5 changed files with 22 additions and 6 deletions
Libraries/LibWeb/Fetch/Fetching
|
@ -744,7 +744,7 @@ void fetch_response_handover(JS::Realm& realm, Infrastructure::FetchParams const
|
|||
transform_stream->set_up(identity_transform_algorithm, flush_algorithm);
|
||||
|
||||
// 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream.
|
||||
auto promise = Streams::readable_stream_pipe_to(internal_response->body()->stream(), transform_stream->writable(), false, false, false, {});
|
||||
auto promise = internal_response->body()->stream()->piped_through(transform_stream->writable());
|
||||
WebIDL::mark_promise_as_handled(*promise);
|
||||
internal_response->body()->set_stream(transform_stream->readable());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue