stefanprodan / AspNetCoreRateLimit

ASP.NET Core rate limiting middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the default retry-time? How to override it?

MarounMaroun opened this issue · comments

I don't see anywhere in the configuration that we can set a time for the block. What's the default and how we can override it?

I figured it out. It defaults to the Period in the GeneralRules. If you wish to change it, you can use PeriodTimespan. Example:

    "GeneralRules": [
      {
        "Endpoint": "*:/api/your-endpoint",
        "Period": "100s",
        "Limit": 20,
        "PeriodTimespan": "0.00:10:00"
      }
    ]

Check TimeSpan formatting for more details.