diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-09 16:47:05 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-09 16:47:05 +0200 |
commit | 3422019e35a7d810566cbafc0d0d9607aac2e116 (patch) | |
tree | 212d19fc2a16a6ada29e187f3f923af0868cc491 /AK/URL.cpp | |
parent | 27d1e7f432f2e79ec77508fbe9bd9b0cccd37a10 (diff) | |
download | serenity-3422019e35a7d810566cbafc0d0d9607aac2e116.zip |
AK: Unbreak parsing of file:// URLs with no host
We should still accept file:/// in the URL parser. :^)
Diffstat (limited to 'AK/URL.cpp')
-rw-r--r-- | AK/URL.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/AK/URL.cpp b/AK/URL.cpp index 1d60fb53eb..1f84604202 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -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() == ':') { |