1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibWeb: Add interface for 'concept-url-parser'

This does not implement extra functionality on top of the basic parser,
but allows multiple places in LibWeb to call the 'correct' interface for
when it is fully implemented.
This commit is contained in:
Shannon Booth 2023-07-15 14:24:58 +12:00 committed by Andreas Kling
parent 7ef4689383
commit 6fecd8cc44
6 changed files with 37 additions and 11 deletions

View file

@ -6,7 +6,6 @@
#include <AK/Debug.h>
#include <AK/TypeCasts.h>
#include <AK/URLParser.h>
#include <LibJS/Heap/Heap.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/VM.h>
@ -14,6 +13,7 @@
#include <LibWeb/Fetch/Infrastructure/FetchParams.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
#include <LibWeb/URL/URL.h>
namespace Web::Fetch::Infrastructure {
@ -113,7 +113,7 @@ ErrorOr<Optional<AK::URL>> Response::location_url(Optional<String> const& reques
return Optional<AK::URL> {};
// 3. If location is a header value, then set location to the result of parsing location with responses URL.
auto location = AK::URLParser::parse(location_values.first(), url());
auto location = URL::parse(location_values.first(), url());
if (!location.is_valid())
return Error::from_string_view("Invalid 'Location' header URL"sv);