Exemplo n.º 1
0
 /// <summary>
 /// On non configured system action
 /// </summary>
 /// <param name="ctx"></param>
 /// <param name="next"></param>
 public static async Task NonConfiguredSystem(this HttpContext ctx, Func <Task> next)
 {
     if (ctx.Request.Cookies.Count >= 2)
     {
         ctx.DeleteCookies();
     }
     if (ctx.Request.Path.Value != "/" &&
         UrlRewriteHelper.IsNotSystemRoute(ctx.Request.Path.Value) &&
         !ctx.Request.Path.Value.ToLowerInvariant().StartsWith("/installer", StringComparison.Ordinal))
     {
         var originalPath = ctx.Request.Path.Value;
         ctx.Items["originalPath"] = originalPath;
         ctx.Request.Path          = "/Installer";
         await next();
     }
     else
     {
         await next();
     }
 }