Exemple #1
0
        public IpThrottleMiddleware(RequestDelegate next, ThrottleOptions options, ICounterStore counterStore, ILogger <IdThrottleMiddleware> logger)
            : base(next, options, counterStore, logger)
        {
            var matcher = new IpAddressRuleMatcher(Options.ClientWhitelist, Options.ClientPolicies);

            Processor = new ThrottleProcessor(Options, counterStore, matcher);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ThrottleMiddleware"/> class.
 /// Makes this protected to prevent public call on an abstract class.
 /// </summary>
 /// <param name="next">The next middleware.</param>
 /// <param name="options">The throttle options.</param>
 /// <param name="counterStore">The store for throttle counters.</param>
 /// <param name="logger">The logger.</param>
 protected ThrottleMiddleware(RequestDelegate next, ThrottleOptions options, ICounterStore counterStore, ILogger logger)
 {
     Next         = next;
     Options      = options;
     CounterStore = counterStore;
     Logger       = logger;
 }