AK: Simplify "cannot have a username/password/port"

This is an editorial change in the URL spec, see:

https://github.com/whatwg/url/commit/f78785
This commit is contained in:
Shannon Booth 2023-09-11 22:06:41 +12:00 committed by Andreas Kling
parent e5c9d7ce26
commit e9670862a0
Notes: sideshowbarker 2024-07-17 09:49:48 +09:00

View file

@ -126,8 +126,7 @@ void URL::append_path(StringView path)
bool URL::cannot_have_a_username_or_password_or_port() const bool URL::cannot_have_a_username_or_password_or_port() const
{ {
// A URL cannot have a username/password/port if its host is null or the empty string, or its scheme is "file". // A URL cannot have a username/password/port if its host is null or the empty string, or its scheme is "file".
// FIXME: The spec does not mention anything to do with 'cannot be a base URL'. return m_host.has<Empty>() || m_host == String {} || m_scheme == "file"sv;
return m_host.has<Empty>() || m_host == String {} || m_cannot_be_a_base_url || m_scheme == "file"sv;
} }
// FIXME: This is by no means complete. // FIXME: This is by no means complete.