mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
LibWeb: Begin support for requesting blob URLs with Fetch infrastructure
This does not yet implement requests with a Range header.
This commit is contained in:
parent
9957d48f48
commit
a14f6e42a8
Notes:
sideshowbarker
2024-07-18 03:23:00 +09:00
Author: https://github.com/trflynn89
Commit: a14f6e42a8
Pull-request: https://github.com/SerenityOS/serenity/pull/20318
Reviewed-by: https://github.com/linusg ✅
2 changed files with 82 additions and 2 deletions
|
@ -69,6 +69,9 @@ WebIDL::ExceptionOr<void> Body::fully_read(JS::Realm& realm, Web::Fetch::Infrast
|
|||
// FIXME: Implement the streams spec - this is completely made up for now :^)
|
||||
if (auto const* byte_buffer = m_source.get_pointer<ByteBuffer>()) {
|
||||
TRY_OR_THROW_OOM(vm, success_steps(*byte_buffer));
|
||||
} else if (auto const* blob_handle = m_source.get_pointer<JS::Handle<FileAPI::Blob>>()) {
|
||||
auto byte_buffer = TRY_OR_THROW_OOM(vm, ByteBuffer::copy((*blob_handle)->bytes()));
|
||||
TRY_OR_THROW_OOM(vm, success_steps(move(byte_buffer)));
|
||||
} else {
|
||||
// Empty, Blob, FormData
|
||||
error_steps(WebIDL::DOMException::create(realm, "DOMException", "Reading from Blob, FormData or null source is not yet implemented"sv));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue