diff --git a/Libraries/LibIPC/Decoder.cpp b/Libraries/LibIPC/Decoder.cpp index 5334859783c..58b61c4143a 100644 --- a/Libraries/LibIPC/Decoder.cpp +++ b/Libraries/LibIPC/Decoder.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace IPC { @@ -81,13 +82,15 @@ template<> ErrorOr decode(Decoder& decoder) { auto url_string = TRY(decoder.decode()); - URL::URL url { url_string }; + auto url = URL::Parser::basic_parse(url_string); + if (!url.has_value()) + return Error::from_string_view("Failed to parse URL in IPC Decode"sv); bool has_blob_url = TRY(decoder.decode()); if (!has_blob_url) - return url; + return url.release_value(); - url.set_blob_url_entry(URL::BlobURLEntry { + url->set_blob_url_entry(URL::BlobURLEntry { .object = URL::BlobURLEntry::Object { .type = TRY(decoder.decode()), .data = TRY(decoder.decode()), @@ -95,7 +98,7 @@ ErrorOr decode(Decoder& decoder) .environment { .origin = TRY(decoder.decode()) }, }); - return url; + return url.release_value(); } template<>