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

Fails to parse utf8 encoded json #14

Open
TheWisestOne opened this issue Oct 24, 2023 · 1 comment
Open

Fails to parse utf8 encoded json #14

TheWisestOne opened this issue Oct 24, 2023 · 1 comment
Assignees
Labels

Comments

@TheWisestOne
Copy link

Honestly I'm not 100% sure if these are valid, but I have encountered data URIs that look like this:

data:application/json;utf8,{"key":"some value"}

OR

data:application/json,{"key":"some value"}

Running parseDataUrl on these returns false, so I have to special case these in my code. Raising this issue in case these should be supported by the library, but I will defer to public opinion on if this is in line with the data url specification

@killmenot
Copy link
Owner

@TheWisestOne Thank you for letting me know about the issue. I think I will patch the lib on the week-end to make sure that the case data:application/json,{"key":"some value"} will work. I found a problem.

Regarding data:application/json;utf8,{"key":"some value"} - need to research a bit more.

P.S.
If it's urgent you can use the following one: https://github.com/jsdom/data-urls right now. Both your examples work correctly with it.

@killmenot killmenot self-assigned this Oct 24, 2023
@killmenot killmenot added the bug label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants