Esempio n. 1
0
        /// <summary>
        /// 主调用方法
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public async Task Invoke(HttpContext context)
        {
            var ips = ConfigHelper.Get(ConfigHelper.WebBlackIps);
            var ip  = SystemHelper.GetClientIp();
            var ua  = HttpContextHelper.GetUa();

            if (context.Request.Headers.ContainsKey("DYLS-Leakscan") || context.Request.Headers.ContainsKey("X-Scanner-Uuid") || ua.Contains("DYLS_security_team") || ips.Contains(ip))
            {
                await context.Response.WriteAsync("success");

                return;
            }
            await _next(context);
        }