mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
AK: Make URL::to_string() produce a data URL for data URLs :^)
This commit is contained in:
parent
e3232eb25b
commit
9e365a6c1c
1 changed files with 11 additions and 0 deletions
11
AK/URL.cpp
11
AK/URL.cpp
|
@ -241,6 +241,17 @@ String URL::to_string() const
|
|||
{
|
||||
StringBuilder builder;
|
||||
builder.append(m_protocol);
|
||||
|
||||
if (m_protocol == "data") {
|
||||
builder.append(':');
|
||||
builder.append(m_data_mime_type);
|
||||
if (m_data_payload_is_base64)
|
||||
builder.append(";base64");
|
||||
builder.append(',');
|
||||
builder.append(m_data_payload);
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
builder.append("://");
|
||||
if (protocol() != "file") {
|
||||
builder.append(m_host);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue