1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

Everywhere: Use unqualified AK::URL

Now possible in LibWeb now that there is no longer a Web::URL.
This commit is contained in:
Shannon Booth 2024-02-11 20:15:39 +13:00 committed by Andreas Kling
parent f9e5b43b7a
commit 9ce8189f21
156 changed files with 471 additions and 471 deletions

View file

@ -29,12 +29,12 @@ Trustworthiness is_origin_potentially_trustworthy(HTML::Origin const& origin)
// 4. If origins host matches one of the CIDR notations 127.0.0.0/8 or ::1/128 [RFC4632], return "Potentially Trustworthy".
// FIXME: This would be nicer if URL::IPv4Address and URL::IPv6Address were instances of AK::IPv4Address and AK::IPv6Address
if (origin.host().has<AK::URL::IPv4Address>()) {
if ((origin.host().get<AK::URL::IPv4Address>() & 0xff000000) != 0)
if (origin.host().has<URL::IPv4Address>()) {
if ((origin.host().get<URL::IPv4Address>() & 0xff000000) != 0)
return Trustworthiness::PotentiallyTrustworthy;
} else if (origin.host().has<AK::URL::IPv6Address>()) {
auto ipv6_address = origin.host().get<AK::URL::IPv6Address>();
static constexpr AK::URL::IPv6Address loopback { 0, 0, 0, 0, 0, 0, 0, 1 };
} else if (origin.host().has<URL::IPv6Address>()) {
auto ipv6_address = origin.host().get<URL::IPv6Address>();
static constexpr URL::IPv6Address loopback { 0, 0, 0, 0, 0, 0, 0, 1 };
if (ipv6_address == loopback)
return Trustworthiness::PotentiallyTrustworthy;
}
@ -68,7 +68,7 @@ Trustworthiness is_origin_potentially_trustworthy(HTML::Origin const& origin)
}
// https://w3c.github.io/webappsec-secure-contexts/#is-url-trustworthy
Trustworthiness is_url_potentially_trustworthy(AK::URL const& url)
Trustworthiness is_url_potentially_trustworthy(URL const& url)
{
// 1. If url is "about:blank" or "about:srcdoc", return "Potentially Trustworthy".
if (url == "about:blank"sv || url == "about:srcdoc"sv)