summaryrefslogtreecommitdiff
path: root/AK/URL.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-09 16:47:05 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-09 16:47:05 +0200
commit3422019e35a7d810566cbafc0d0d9607aac2e116 (patch)
tree212d19fc2a16a6ada29e187f3f923af0868cc491 /AK/URL.cpp
parent27d1e7f432f2e79ec77508fbe9bd9b0cccd37a10 (diff)
downloadserenity-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.cpp8
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() == ':') {