mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
AK: Add support for about: URLs
This commit is contained in:
12
AK/URL.cpp
12
AK/URL.cpp
@@ -93,6 +93,12 @@ bool URL::parse(const StringView& string)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_protocol == "about") {
|
||||
buffer.clear();
|
||||
state = State::InPath;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (consume() != '/')
|
||||
return false;
|
||||
if (consume() != '/')
|
||||
@@ -245,6 +251,12 @@ String URL::to_string() const
|
||||
StringBuilder builder;
|
||||
builder.append(m_protocol);
|
||||
|
||||
if (m_protocol == "about") {
|
||||
builder.append(':');
|
||||
builder.append(m_path);
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
if (m_protocol == "data") {
|
||||
builder.append(':');
|
||||
builder.append(m_data_mime_type);
|
||||
|
||||
Reference in New Issue
Block a user