Esempio n. 1
0
 /// <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();
     }
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 /// <summary>
 /// Redireciona a requisição.
 /// </summary>
 /// <param name="url"></param>
 public override void Redirect(string url)
 {
     OwinResponse.Redirect(url);
 }