mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
AK: Accept optional url and state override parameters in URLParser
These are required in the specification and used by the web's URL built-in, this commit also removes the Badge<AK::URL> from URLParser to allow other classes that need to call the parser directly like the web's URL built-in to do so.
This commit is contained in:
parent
6fa4fc8353
commit
55b67ba7a7
3 changed files with 116 additions and 114 deletions
|
@ -17,7 +17,7 @@ namespace AK {
|
|||
|
||||
// FIXME: It could make sense to force users of URL to use URLParser::parse() explicitly instead of using a constructor.
|
||||
URL::URL(StringView const& string)
|
||||
: URL(URLParser::parse({}, string))
|
||||
: URL(URLParser::parse(string))
|
||||
{
|
||||
if constexpr (URL_PARSER_DEBUG) {
|
||||
if (m_valid)
|
||||
|
@ -44,7 +44,7 @@ URL URL::complete_url(String const& string) const
|
|||
if (!is_valid())
|
||||
return {};
|
||||
|
||||
return URLParser::parse({}, string, this);
|
||||
return URLParser::parse(string, this);
|
||||
}
|
||||
|
||||
void URL::set_scheme(String scheme)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue