stefanprodan / AspNetCoreRateLimit

ASP.NET Core rate limiting middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rate configuration failure problem

qq1176914912 opened this issue · comments

My current idea is that the speed is not configured by *, and the configuration is based on the specific path. But now the problem is that the specific path I configured is not effective, and all of them are based on *. I don't know why.
My profile is as follows
` "ClientRateLimiting": {
"EnableEndpointRateLimiting": true,
"StackBlockedRequests": true,
"ClientIdHeader": "Authorization",
"HttpStatusCode": 429, // TooManyRequests
"QuotaExceededResponse": {
"Content": "{{ "message": "访问频繁!", "details": "超出请求次数规则. 规则: 每{1}只能访问{0}次. 请在 {2} 秒(s)后重试." }}",
"ContentType": "application/json;",
"StatusCode": 429
},
"GeneralRules": [

  {
    "Endpoint": "*",
    "Period": "1m",
    "Limit": 10
  },
  {
    
    "Endpoint": "get:/productmanage",
    "Period": "1m",
    "Limit": 20
  }
]

}`
The test found that when I accessed productmanage through get, I still followed the rule of *, prompting that 1m accesses 10 times instead of 20 times.

My current demand is that * requires less time and visits, while individual specific paths require more time and visits.

@MarkCiliaVincenti @cristipufu I'm sorry to bother you, but I don't know who to look for. I think this problem has been encountered before, but it hasn't been solved in the end. Is this a bug or something?Similar questions:#321

Hi @qq1176914912, I am not the right person to speak to. @cristipufu is. However I'd suggest that you try an experiment putting the endpoint * after the one for get:/productmanage and see if that makes a difference.

Hi @qq1176914912, I am not the right person to speak to. @cristipufu is. However I'd suggest that you try an experiment putting the endpoint * after the one for get:/productmanage and see if that makes a difference.

I'm very sorry to bother you, but I tried your method and it still doesn't work.