/// <summary> /// Redidireona a requisição. /// </summary> /// <param name="url"></param> /// <param name="endResponse"></param> public override void Redirect(string url, bool endResponse) { OwinResponse.Redirect(url); if (endResponse) { End(); } }
public override Task ProcessRequest(HostContext context) { string redirectWhen = "____Never____"; if (!String.IsNullOrEmpty(context.Request.QueryString["redirectWhen"])) { redirectWhen = context.Request.QueryString["redirectWhen"]; } var owinRequest = new OwinRequest(context.Environment); if (owinRequest.Path.Value.Contains("/" + redirectWhen)) { var response = new OwinResponse(context.Environment); // Redirect to an invalid page response.Redirect("http://" + owinRequest.Host); return(TaskAsyncHelper.Empty); } return(base.ProcessRequest(context)); }
/// <summary> /// Redireciona a requisição. /// </summary> /// <param name="url"></param> public override void Redirect(string url) { OwinResponse.Redirect(url); }