mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +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
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