I a trying to test the following code. This is a summarised code.
string url = filterContext.HttpContext.Request.Url.ToString();
if (Url.IsLocalUrl(url))
{
return Redirect(url);
}
else
{
return RedirectToAction("Index", "Home");
}
In this code the url is obtained from context but in my original code it is passed to the controller action as string from a Authorize filter and looks like http://localhost:53249/Products in Debug.Write. However the IF is not satisfied that the url is local URL can someone explain what I am doing wrong.