AspNetCoreRateLimit icon indicating copy to clipboard operation
AspNetCoreRateLimit copied to clipboard

[Question] Use best match rule instead of most restrictive rule

Open KiritchoukC opened this issue 2 years ago • 3 comments

Hello guys,

Title says it all, I'd like to implement rate-limiting on my Api with every endpoints being blocked after 40 requests with a 60s period except for some endpoints where I'd like to limit it to 120 requests per 60s.

Here's what I've done

      {
        "Endpoint": ".+",
        "Period": "60s",
        "Limit": 40
      },
      {
        "Endpoint": ":/api/thingy/V2/.+",
        "Period": "60s",
        "Limit": 120
      }

But for example, endpoint /api/thingy/V2/values is blocked after 40 requests.

Is there a way to use the best matching rule? Or the first one that matches so we can rearrange the list order?

KiritchoukC avatar Apr 12 '22 09:04 KiritchoukC

Try to change the order.

offirpeer avatar Aug 17 '22 11:08 offirpeer

I tried, it doesn't change the behavior

KiritchoukC avatar Aug 17 '22 19:08 KiritchoukC

I tried, it doesn't change the behavior

I have encountered the same problem. Have you solved it?

qq1176914912 avatar Feb 07 '23 01:02 qq1176914912