我正在用ASP.NET核心构建一个网站,我刚刚开始设置一些过滤器来控制对某些方法的访问,一些方法的标准之一就是请求的Referer头。我想通过构造函数将Referer的有效URL作为参数发送到操作过滤器。我创建了以下过滤器: public class RefererFilter : ActionFilterAttribute private List<string
在startup上,我已经设置了我的操作过滤器。services.AddScoped<CheckThisAttribute>();public class CheckThisAttribute : ActionFilterAttributeServiceFilter(typeof(CheckThisAttribute))]{正如您可能已经注意到的,我在构造函数中将name