AspNetCoreRateLimit: ClientRules does not overwrite GeneralRules

Hi, i think client rules does not overwrite general rules. This is my configuration:

"ClientRateLimiting": {
    "EnableEndpointRateLimiting": false,
    "StackBlockedRequests": false,
    "ClientIdHeader": "X-ClientId",
    "HttpStatusCode": 429,
    "ClientRules": [
      {
        "ClientId": "cid123",
        "Rules": [
          {
            "Endpoint": "*",
            "Period": "1h",
            "Limit": 100
          }
        ]
      }
    ],
    "GeneralRules": [
      {
        "Endpoint": "*",
        "Period": "1s",
        "Limit": 2
      },
      {
        "Endpoint": "*",
        "Period": "1h",
        "Limit": 5
      }
    ]
  }

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

@roycornelissen, please find the gist https://gist.github.com/r4nc1d/f01e4594917843189299eed98f5043e2

For simplicity i just used RedisCache, that way I could just used the AbsoluteExpirationRelativeToNow, The key will get removed automatically once set time has expired.