OWASP/owasp-java-encoder

Create a encodeForJSON() function

jmanico opened this issue · 6 comments

We should create a function to safely embed JSON on a webpage simular to to what https://github.com/yahoo/serialize-javascript accomplishes.

This would be a great feature as we have needed something similar in the past.

Can I try this?

@jmanico Can u give any pointers from where I can start studying for this?

Wouldn't Encode.forJavaScriptSource() work? You would just be responsible for quoting the output.