mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:47:44 +00:00
URL: Parse URLs that lack a path (e.g "http://serenityos.org")
This commit is contained in:
parent
7b6aba4284
commit
f1f928670e
1 changed files with 8 additions and 0 deletions
|
@ -109,6 +109,14 @@ bool URL::parse(const StringView& string)
|
||||||
continue;
|
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);
|
m_path = String::copy(buffer);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue