-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rate limiting counters for post endpoint #224
Comments
Hello, I tried to configure it as below: |
If you want to specify a different behavior (https://github.com/stefanprodan/AspNetCoreRateLimit/blob/master/src/AspNetCoreRateLimit/CounterKeyBuilders/EndpointCounterKeyBuilder.cs), you need to implement a custom counter and override the default implementation, eg: public class CustomRateLimitConfiguration : RateLimitConfiguration
{
public override ICounterKeyBuilder EndpointCounterKeyBuilder { get; } = new EndpointCounterKeyBuilder();
} |
Ok, if I configured it as below: In current version you will not get headers related to rate limit. |
If you want to rate limit endpoints like
{
"Endpoint": "get:/api/clients/*",
"Period": "5m",
"Limit": 100
}
public class CustomRateLimitConfiguration : RateLimitConfiguration
{
public override ICounterKeyBuilder EndpointCounterKeyBuilder { get; } = new EndpointCounterKeyBuilder();
}
services.AddSingleton<IRateLimitConfiguration, CustomRateLimitConfiguration>(); |
Hello,
I would report issue, I have configured rate limit for endpoint:
"Endpoint": "post:/api/clients"
It works fine for endpoint: https://localhost:5001/api/clients
but when I send request to the same endpont with '/' at the end: https://localhost:5001/api/clients**/** the rate limit is not working, I don't get headers in response related to rate limit eg. X-Rate-Limit-Limit, X-Rate-Limit-Remaining or X-Rate-Limit-Reset.
It should be stored under one counter, but it doesn't work now.
Could you look at this problem?
Thanks.
The text was updated successfully, but these errors were encountered: