-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report invalid data URL errors. #562
Comments
{
"image": "https://example.com/foo bar"
}
|
💯 Do we have an issue for this yet? If not, can you make one? I assume we should just close this one as "wontfix" then (given the rest of your comment), yeah? |
I don't think there is one. Maybe my comment above is it.
I'm fine leaving it open. Or making something related, but I'm not sure what that would be. It's probably not a bad idea to allow more descriptive errors if/when possible. Current heuristics used here are weak. They could perhaps be improved somehow. If not at a spec level, then extra per-implementation details. |
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 intoAn invalid data URL will currently be treated as a relative URL by the parser:
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.
The text was updated successfully, but these errors were encountered: