mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
URL: Parse URLs that lack a path (e.g "http://serenityos.org")
This commit is contained in:
parent
7b6aba4284
commit
f1f928670e
Notes:
sideshowbarker
2024-07-19 11:39:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f1f928670e7
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue