LibWeb: Make Web::URL::host_is_domain accept an AK::URL::Host

Which allows us to avoid serializing the host only to try and reparse it
again as either an IPv4 or IPv6 address.
This commit is contained in:
Shannon Booth 2023-07-29 10:01:20 +12:00 committed by Andreas Kling
parent 8751be09f9
commit 3cb65645cf
Notes: sideshowbarker 2024-07-16 17:12:03 +09:00
3 changed files with 4 additions and 6 deletions

View file

@ -256,7 +256,7 @@ WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::
// - requests current URLs scheme is "http"
request->current_url().scheme() == "http"sv
// - requests current URLs host is a domain
&& URL::host_is_domain(request->current_url().serialized_host().release_value_but_fixme_should_propagate_errors())
&& URL::host_is_domain(request->current_url().host())
// FIXME: - Matching requests current URLs host per Known HSTS Host Domain Name Matching results in either a
// superdomain match with an asserted includeSubDomains directive or a congruent match (with or without an
// asserted includeSubDomains directive) [HSTS]; or DNS resolution for the request finds a matching HTTPS RR