mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of the system, as LibCore depends on LibURL. This change has two main benefits: * Moving AK back more towards being an agnostic library that can be used between the kernel and userspace. URL has never really fit that description - and is not used in the kernel. * URL _should_ depend on LibUnicode, as it needs punnycode support. However, it's not really possible to do this inside of AK as it can't depend on any external library. This change brings us a little closer to being able to do that, but unfortunately we aren't there quite yet, as the code generators depend on LibCore.
This commit is contained in:
@@ -29,7 +29,7 @@ WebIDL::ExceptionOr<bool> NavigatorBeaconMixin::send_beacon(String const& url, O
|
||||
auto origin = relevant_settings_object.origin();
|
||||
|
||||
// 3. Set parsedUrl to the result of the URL parser steps with url and base. If the algorithm returns an error, or if parsedUrl's scheme is not "http" or "https", throw a "TypeError" exception and terminate these steps.
|
||||
auto parsed_url = URLParser::basic_parse(url, base_url);
|
||||
auto parsed_url = URL::Parser::basic_parse(url, base_url);
|
||||
if (!parsed_url.is_valid())
|
||||
return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, MUST(String::formatted("Beacon URL {} is invalid.", url)) };
|
||||
if (parsed_url.scheme() != "http" && parsed_url.scheme() != "https")
|
||||
|
||||
Reference in New Issue
Block a user