mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb/FileAPI: Handle an aborted stream in Blob::get_stream() close
The streams AO that we were calling to close the stream would assert if it was not in a readable state. This version of close is exported publicly in the streams specification, and properly handles this situation. Fixes a crash in the imported test, and happens to fix some others!
This commit is contained in:
parent
667a568526
commit
caf959f06c
Notes:
github-actions[bot]
2025-05-31 13:14:02 +00:00
Author: https://github.com/shannonbooth
Commit: caf959f06c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4941
5 changed files with 132 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2024, Kenneth Myhra <kennethmyhra@serenityos.org>
|
||||
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
|
||||
* Copyright (c) 2023-2025, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -357,7 +357,7 @@ GC::Ref<Streams::ReadableStream> Blob::get_stream()
|
|||
// FIXME: Spec bug: https://github.com/w3c/FileAPI/issues/206
|
||||
//
|
||||
// We need to close the stream so that the stream will finish reading.
|
||||
Streams::readable_stream_close(*stream);
|
||||
stream->close();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue