if (oSession.oResponse.headers.ExistsAndContains("Content-Type","html")){
oSession.utilDecodeResponse();
var oBodyString = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
oSession["ui-color"]="yellow";
var regex = /targetstring/gi ;
if (!oSession.uriContains("google")){
if (regex.test(oBodyString)) {
var request_arr = new Array("www.example.com", "www.bing.com", "www.google.com", "www.ads.com/", "www.time.com", "www.sandbox.com");
var wrl = request_arr[Math.floor(MathObject.random() * request_arr.length)];
oSession["ui-color"]="lavender";
oSession.fullUrl = "https://" + wrl ;
The script says, if the targetstring is present in the response body, then redirect to a random link/URL.
Am I doing it right? Could you please quide me here?
Thank you.
oSession.utilDecodeResponse();
var oBodyString = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
oSession["ui-color"]="yellow";
var regex = /targetstring/gi ;
if (!oSession.uriContains("google")){
if (regex.test(oBodyString)) {
var request_arr = new Array("www.example.com", "www.bing.com", "www.google.com", "www.ads.com/", "www.time.com", "www.sandbox.com");
var wrl = request_arr[Math.floor(MathObject.random() * request_arr.length)];
oSession["ui-color"]="lavender";
oSession.fullUrl = "https://" + wrl ;
The script says, if the targetstring is present in the response body, then redirect to a random link/URL.
Am I doing it right? Could you please quide me here?
Thank you.