LibURL: Replace use of URL::get_public_suffix

It is confusing to have both URL::Host::public_suffix and
URL:get_public_suffix, both with slightly different semantics.

Instead, use PublicSuffixData for cases that just want a direct
match against the list, and URL::Host::public_suffix in LibWeb
land as the URL spec defined AO.
This commit is contained in:
Shannon Booth 2025-06-28 21:05:42 +12:00 committed by Tim Ledbetter
parent e6ecafea84
commit a2b523eeb8
Notes: github-actions[bot] 2025-06-29 11:49:11 +00:00
5 changed files with 9 additions and 13 deletions

View file

@ -3845,10 +3845,10 @@ static bool is_a_registrable_domain_suffix_of_or_is_equal_to(StringView host_suf
// * hostSuffix equals hostSuffix's public suffix; or
// * hostSuffix, prefixed by U+002E (.), matches the end of originalHost's public suffix,
// then return false. [URL]
if (host_suffix_string == URL::get_public_suffix(host_suffix_string))
if (host_suffix_string == host_suffix->public_suffix())
return false;
auto original_host_public_suffix = URL::get_public_suffix(original_host_string);
auto original_host_public_suffix = original_host.public_suffix();
VERIFY(original_host_public_suffix.has_value());
if (original_host_public_suffix->ends_with_bytes(prefixed_host_suffix))