From 4c08f8915b741b67a0fed3ba2f406edfed9aca1b Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 6 Mar 2026 17:14:25 +0800 Subject: [PATCH] fix: clarify ban policy note in RateLimitDemo to reflect permanent denial of requests --- .../MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs | 2 +- .../Pages/RateLimitDemo/Index.cshtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 @@
Partition: PartitionByParameter
Rule: maxCount: 0 within 30 seconds
- Note: Setting maxCount 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.