diff --git a/AK/URL.cpp b/AK/URL.cpp index dc5286e620..81fda73dd7 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -109,6 +109,14 @@ bool URL::parse(const StringView& string) continue; } } + if (state == State::InHostname) { + // We're still in the hostname, so e.g "http://serenityos.org" + if (buffer.is_empty()) + return false; + m_host = String::copy(buffer); + m_path = "/"; + return true; + } m_path = String::copy(buffer); return true; }