1
Fork 0
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:
Andreas Kling 2020-04-26 22:59:12 +02:00
parent e3232eb25b
commit 9e365a6c1c

View file

@ -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);