Untitled
unknown
csharp
8 months ago
322 B
5
Indexable
services.AddRateLimiter(options =>
options.AddPolicy("PerIpRateLimit", context =>
RateLimitPartition.GetFixedWindowLimiter(
context.Connection.RemoteIpAddress.ToString(),
_ => new FixedWindowRateLimiterOptions
{
PermitLimit = 100,
Window = TimeSpan.FromMinutes(1)
}));
);
app.UseRateLimiter();
Editor is loading...
Leave a Comment