1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

AK: Unbreak parsing of file:// URLs with no host

We should still accept file:/// in the URL parser. :^)
This commit is contained in:
Andreas Kling 2020-05-09 16:47:05 +02:00
parent 27d1e7f432
commit 3422019e35
2 changed files with 25 additions and 1 deletions

View file

@ -112,8 +112,14 @@ bool URL::parse(const StringView& string)
buffer.append(consume());
continue;
}
if (buffer.is_empty())
if (buffer.is_empty()) {
if (m_protocol == "file") {
m_host = "";
state = State::InPath;
continue;
}
return false;
}
m_host = String::copy(buffer);
buffer.clear();
if (peek() == ':') {