1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +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

@ -104,7 +104,7 @@ bool Response::is_network_error() const
}
// https://fetch.spec.whatwg.org/#concept-response-url
Optional<AK::URL const&> Response::url() const
Optional<URL const&> Response::url() const
{
// A response has an associated URL. It is a pointer to the last URL in responses URL list and null if responses URL list is empty.
// NOTE: We have to use the virtual getter here to not bypass filtered responses.
@ -114,23 +114,23 @@ Optional<AK::URL const&> Response::url() const
}
// https://fetch.spec.whatwg.org/#concept-response-location-url
ErrorOr<Optional<AK::URL>> Response::location_url(Optional<String> const& request_fragment) const
ErrorOr<Optional<URL>> Response::location_url(Optional<String> const& request_fragment) const
{
// The location URL of a response response, given null or an ASCII string requestFragment, is the value returned by the following steps. They return null, failure, or a URL.
// 1. If responses status is not a redirect status, then return null.
// NOTE: We have to use the virtual getter here to not bypass filtered responses.
if (!is_redirect_status(status()))
return Optional<AK::URL> {};
return Optional<URL> {};
// 2. Let location be the result of extracting header list values given `Location` and responses header list.
auto location_values_or_failure = TRY(extract_header_list_values("Location"sv.bytes(), m_header_list));
if (location_values_or_failure.has<Infrastructure::ExtractHeaderParseFailure>() || location_values_or_failure.has<Empty>())
return Optional<AK::URL> {};
return Optional<URL> {};
auto const& location_values = location_values_or_failure.get<Vector<ByteBuffer>>();
if (location_values.size() != 1)
return Optional<AK::URL> {};
return Optional<URL> {};
// 3. If location is a header value, then set location to the result of parsing location with responses URL.
auto location = DOMURL::parse(location_values.first(), url());