mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Implement Blob::bytes()
Implements https://w3c.github.io/FileAPI/#dom-blob-bytes.
This commit is contained in:
parent
1ce9bbdd6d
commit
c5f1e47883
Notes:
github-actions[bot]
2024-07-26 08:22:29 +00:00
Author: https://github.com/kemzeb
Commit: c5f1e47883
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/802
Reviewed-by: https://github.com/kennethmyhra ✅
Reviewed-by: https://github.com/shannonbooth
12 changed files with 52 additions and 10 deletions
|
@ -841,7 +841,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> scheme_fetch(JS::Realm& r
|
|||
// 8. If request’s header list does not contain `Range`:
|
||||
if (!request->header_list()->contains("Range"sv.bytes())) {
|
||||
// 1. Let bodyWithType be the result of safely extracting blob.
|
||||
auto body_with_type = TRY(safely_extract_body(realm, blob->bytes()));
|
||||
auto body_with_type = TRY(safely_extract_body(realm, blob->raw_bytes()));
|
||||
|
||||
// 2. Set response’s status message to `OK`.
|
||||
response->set_status_message(MUST(ByteBuffer::copy("OK"sv.bytes())));
|
||||
|
@ -2150,7 +2150,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> nonstandard_resource_load
|
|||
return {};
|
||||
},
|
||||
[&](JS::Handle<FileAPI::Blob> const& blob_handle) -> WebIDL::ExceptionOr<void> {
|
||||
load_request.set_body(TRY_OR_THROW_OOM(vm, ByteBuffer::copy(blob_handle->bytes())));
|
||||
load_request.set_body(TRY_OR_THROW_OOM(vm, ByteBuffer::copy(blob_handle->raw_bytes())));
|
||||
return {};
|
||||
},
|
||||
[](Empty) -> WebIDL::ExceptionOr<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue