diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 17becbed7e..a3fa33cb48 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -248,7 +248,7 @@ public class MyProjectNameWebModule : AbpModule .PartitionByCurrentTenant(); }); - // Demo 12: Ban policy (maxCount: 0) - blocks all requests for the duration + // Demo 12: Ban policy (maxCount: 0) - permanently denies all requests options.AddPolicy("Demo_BanPolicy", policy => { policy.WithFixedWindow(TimeSpan.FromSeconds(30), maxCount: 0) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/RateLimitDemo/Index.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/RateLimitDemo/Index.cshtml index ee82fe4c2a..ad6d9ea9f1 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/RateLimitDemo/Index.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/RateLimitDemo/Index.cshtml @@ -441,7 +441,7 @@
PartitionByParametermaxCount: 0 within 30 secondsmaxCount to 0 creates a ban policy — every request is blocked for the entire window duration. Useful for temporarily banning a user or resource.
+ Note: Setting maxCount to 0 creates a ban policy — every request is permanently denied regardless of the window duration. RetryAfter is null since there is no window to wait for.