Skip to content

Url

Url object is used to encode/decode text in the application/x-www-form-urlencoded MIME format.

Basic Usage

var url = require("utils/v4/url");
var response = require("http/v4/response");

response.println(url.encode('<![CDATA[<meta http-equiv="refresh" content="0;url=javascript:document.vulnerable=true;">]]>'));
response.println(url.decode('%3C%21%5BCDATA%5B%3Cmeta+http-equiv%3D%22refresh%22+content%3D%220%3Burl%3Djavascript%3Adocument.vulnerable%3Dtrue%3B%22%3E%5D%5D%3E'));

response.flush();
response.close();

Functions


Function Description Returns
decode(input) Decode an input string from application/x-www-form-urlencoded format string
encode(input) Encode an input string to application/x-www-form-urlencoded format string
escape(input) Escape an input string to comply to URI RFC 3986 string
Back to top