Skip to content
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

"Uncaught URIError: URI malformed" when using data URIs #66

Open
p-himik opened this issue Sep 20, 2020 · 1 comment
Open

"Uncaught URIError: URI malformed" when using data URIs #66

p-himik opened this issue Sep 20, 2020 · 1 comment

Comments

@p-himik
Copy link

p-himik commented Sep 20, 2020

Accountant uses goog.Uri.parse that in turn uses decodeURI, but it cannot parse data URIs that contain binary data that has not been encoded with base64.

An example of such URI: data:audio/midi,MThd%00%00%00%06%00%01%00%02%01%e0MTrk%00%00%00%19%00%FF%51%03%05%16%15%00%FF%59%02%00%00%00%FF%58%04%04%02%18%08%00%FF%2F%00MTrk%00%00%00%10%00%C0%00%00%90%45%55%83%30%80%45%00%00%FF%2F%00

It's a perfectly fine URI, but it cannot be decoded into a text representation.

@p-himik
Copy link
Author

p-himik commented Sep 20, 2020

BTW data URI are not allowed to be used as navigation URIs, so maybe accountant could just ignore any <a> that has a download attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant