-
Notifications
You must be signed in to change notification settings - Fork 203
Description
Data URLs are frequently used in JSON payloads to store images or other binary (or non-JSON friendly text) data stored as a string.
The work well stored in JSON-LD terms defined with "@type": "@id"
in the context (or less meaningfully as raw string values).
However, the strings are often extremely long and it can be hard to detect error within them such as spaces which may be introduced if the URL is constructed incorrectly or at some point not URI encoded properly (ex: +
getting turned into
).
An invalid data URL will currently be treated as a relative URL by the parser:
{
"image": "data:image/png;base64,qwyfouparst2308in arst829235"
}
The space character in the above (very fake) data URL makes the URL invalid. The parser will therefore drop the term or when parsed in "safe mode" it will throw a "Relative object reference found." error.
It may be useful (at least as an option) to output warnings or errors when invalid data URLs are detected in a document.