mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibWeb: Make factory method of FileAPI::Blob fallible
This commit is contained in:
parent
bc02686ae9
commit
15917146d3
Notes:
sideshowbarker
2024-07-17 10:16:43 +09:00
Author: https://github.com/kennethmyhra
Commit: 15917146d3
Pull-request: https://github.com/SerenityOS/serenity/pull/17491
Reviewed-by: https://github.com/linusg ✅
4 changed files with 5 additions and 5 deletions
|
@ -161,7 +161,7 @@ WebIDL::ExceptionOr<JS::Value> XMLHttpRequest::response()
|
|||
}
|
||||
// 6. Otherwise, if this’s response type is "blob", set this’s response object to a new Blob object representing this’s received bytes with type set to the result of get a final MIME type for this.
|
||||
else if (m_response_type == Bindings::XMLHttpRequestResponseType::Blob) {
|
||||
auto blob_part = FileAPI::Blob::create(realm(), m_received_bytes, get_final_mime_type().type());
|
||||
auto blob_part = TRY(FileAPI::Blob::create(realm(), m_received_bytes, get_final_mime_type().type()));
|
||||
auto blob = TRY(FileAPI::Blob::create(realm(), Vector<FileAPI::BlobPart> { JS::make_handle(*blob_part) }));
|
||||
m_response_object = JS::Value(blob.ptr());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue