You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to setup rate limiting for my app but unfortunately it's not working as expected. In the below example, I've setup a limit to 1 under 1 min. But, I'm able to make multiple requests to the API's wthin the timeframe.
Here is my startup.cs file
builder.Services.AddOptions();// needed to store rate limit counters and ip rulesbuilder.Services.AddMemoryCache();//load general configuration from appsettings.jsonbuilder.Services.Configure<ClientRateLimitOptions>(builder.Configuration.GetSection("ClientRateLimiting"));builder.Services.AddMemoryCache();builder.Services.AddInMemoryRateLimiting();// Add framework Services.builder.Services.AddMvc(option =>option.EnableEndpointRouting=false);// configuration (resolvers, counter key builders)builder.Services.AddSingleton<IRateLimitConfiguration,RateLimitConfiguration>();varapp=builder.Build();app.UseClientRateLimiting();app.UseMvc();awaitapp.RunAsync();
I've looked on stack overflow and googled a bit but couldn't find anything helpful.
Frameworks and libraries:
.NET 6 API,
AspNetCoreRateLimit 5.0.0
The text was updated successfully, but these errors were encountered:
karthikchintala1
changed the title
rate limiting is not working for me with .net6 and AspNetCoreRateLimit 5.0
rate limiting is not working for with .net6 and AspNetCoreRateLimit 5.0
Aug 9, 2023
It might not help you, but I recently tested UseClientRateLimiting in net 6.0 and it was working just fine, I've been having problemas only with UseIpRateLimiting. The only difference was that I set "EnableEndpointRateLimiting": true
I'm trying to setup rate limiting for my app but unfortunately it's not working as expected. In the below example, I've setup a limit to 1 under 1 min. But, I'm able to make multiple requests to the API's wthin the timeframe.
Here is my startup.cs file
and here is my appsettings.json file
I've looked on stack overflow and googled a bit but couldn't find anything helpful.
Frameworks and libraries:
.NET 6 API,
AspNetCoreRateLimit 5.0.0
The text was updated successfully, but these errors were encountered: