Browse Source

fix: clarify ban policy note in RateLimitDemo to reflect permanent denial of requests

pull/25025/head
maliming 4 weeks ago
parent
commit
4c08f8915b
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs
  2. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/RateLimitDemo/Index.cshtml

2
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)

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Pages/RateLimitDemo/Index.cshtml

@ -441,7 +441,7 @@
<div class="rule-desc">
<strong>Partition:</strong> <code>PartitionByParameter</code><br/>
<strong>Rule:</strong> <code>maxCount: 0</code> within <code>30 seconds</code><br/>
<strong>Note:</strong> Setting <code>maxCount</code> to 0 creates a ban policy — <strong>every request is blocked</strong> for the entire window duration. Useful for temporarily banning a user or resource.
<strong>Note:</strong> Setting <code>maxCount</code> to 0 creates a ban policy — <strong>every request is permanently denied</strong> regardless of the window duration. <code>RetryAfter</code> is <code>null</code> since there is no window to wait for.
</div>
<div class="mb-3">
<label class="form-label">Key</label>

Loading…
Cancel
Save