SBarnes wrote:Could it be possible to have an ip exclusion from rates range as well only so that if you are running a web store of the same api you don't wack yourself with the rate limits?
public void RateLimitRequestFilter(IRequest req, IResponse res, object dto)
{
// check if we've exceeded the rate limit for the users sessionId or IP Address and throw a 429
string[] exclusionIPAddresses = {"14.202.205.230/32", "189.40.31.0/24"}; // array of CIDR addressing scheme addresses to skip the rate limit checks for
if (req.RemoteIp.InCIDRExclusions(exclusionIPAddresses))
return;
....
SBarnes wrote:Looks good, thanks Mike
Plugin.PluginReferenceCollection.Read();
AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, System.ResolveEventArgs args) { return AssemblyResolve(sender, args, Plugin); };
SBarnes wrote:I have updated it now include the system settings, as well as the following code to overcome the load/compile issue we were having before. Basically the exclusion range is a comma separated string.
Users browsing this forum: No registered users and 1 guest