mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00: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
|
@ -109,7 +109,7 @@ WebIDL::ExceptionOr<JS::Value> package_data(JS::Realm& realm, ByteBuffer bytes,
|
|||
// Return a Blob whose contents are bytes and type attribute is mimeType.
|
||||
// NOTE: If extracting the mime type returns failure, other browsers set it to an empty string - not sure if that's spec'd.
|
||||
auto mime_type_string = mime_type.has_value() ? mime_type->serialized() : DeprecatedString::empty();
|
||||
return FileAPI::Blob::create(realm, move(bytes), move(mime_type_string));
|
||||
return TRY(FileAPI::Blob::create(realm, move(bytes), move(mime_type_string)));
|
||||
}
|
||||
case PackageDataType::FormData:
|
||||
// If mimeType’s essence is "multipart/form-data", then:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue