Closed dmarlow closed 7 years ago
PR: https://github.com/stefanprodan/WebApiThrottle/pull/106
I have the following config to be used as my "default":
public static readonly ThrottlePolicy Policy = new ThrottlePolicy(perMinute: 20) { // Scope to clients ClientThrottling = true, // Scope to endpoints EndpointThrottling = true };
However, when it serializes to my Redis version of IPolicyRepository, it looks like this:
{ "IpThrottling" : false, "IpWhitelist" : { "$values" : [] }, "IpRules" : {}, "ClientThrottling" : true, "ClientWhitelist" : { "$values" : [] }, "ClientRules" : {}, "EndpointThrottling" : true, "EndpointWhitelist" : { "$values" : [] }, "EndpointRules" : {}, "StackBlockedRequests" : false }
I lose the perMinute default of 20 I had specified and causes my throttling to be non-operational.
perMinute
I believe the fix to be setting ThrottlePolicy.Rates to public from internal.
ThrottlePolicy.Rates
public
internal
Thanks for the PR, published on nuget v1.5.4
PR: https://github.com/stefanprodan/WebApiThrottle/pull/106
I have the following config to be used as my "default":
However, when it serializes to my Redis version of IPolicyRepository, it looks like this:
I lose the
perMinute
default of 20 I had specified and causes my throttling to be non-operational.I believe the fix to be setting
ThrottlePolicy.Rates
topublic
frominternal
.