Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

JSON prefix strip #1

Open
silviusimeria opened this issue Dec 4, 2017 · 0 comments
Open

JSON prefix strip #1

silviusimeria opened this issue Dec 4, 2017 · 0 comments

Comments

@silviusimeria
Copy link

We are using a prefix before sending back the JSON responses in our API like in the example below:

)]}',
{"data": "wow"}

note that the above prefix is in fact ")]}',\n" but sometimes the white spaces are stripped out and it's only ")]}',"

"Prefixing the JSON string in this manner is used to help prevent JSON Hijacking. The prefix renders the string syntactically invalid as a script so that it cannot be hijacked."

This prefix should be stripped before parsing the string as JSON.

I was wondering if you could extend the service with an update for the above and release it.

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

No branches or pull requests

1 participant