Closed bh2smith closed 4 months ago
This is the correct way to parse the URL See the Reference URL parser
The parser doesn't understand what json is, so data:application/json;utf8,{"name":"Bad #1"}
or data:application/json;utf8,{"name":"Bad"}#hash
are parsed in the same way.
If you want to include json containing a hash, I would recommend either escaping the hash: data:application/json;utf8,{"name":"Bad %231"}
or better yet use base64 data URL data:application/json;base64,eyJuYW1lIjoiQmFkICMxIn0
Describe the bug
Here is a test case demonstrating that valid JSON documents containing
#
char are not parsed correctly:What appears to be happening is the
#
character is being interpreted as the beginning of afragment
(The print statement in the code demonstrates this suspicion).