1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibWeb/MimeSniff: Port MimeType to new String

This commit is contained in:
Linus Groh 2023-03-03 09:27:51 +00:00
parent fabea2a6a7
commit 2d7ce38ee2
7 changed files with 86 additions and 71 deletions

View file

@ -108,7 +108,7 @@ WebIDL::ExceptionOr<JS::Value> package_data(JS::Realm& realm, ByteBuffer bytes,
case PackageDataType::Blob: {
// 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() ? TRY_OR_THROW_OOM(vm, String::from_deprecated_string(mime_type->serialized())) : String {};
auto mime_type_string = mime_type.has_value() ? TRY_OR_THROW_OOM(vm, mime_type->serialized()) : String {};
return TRY(FileAPI::Blob::create(realm, move(bytes), move(mime_type_string)));
}
case PackageDataType::FormData: