Skip to content

Commit 65d2bbd

Browse files
Update rate-limit-samples.md (#35102)
* Update rate-limit-samples.md * Add rate limiting samples to TOC * Fix markdown header levels in rate-limit samples * Update aspnetcore/performance/rate-limit-samples.md
1 parent 5cc9a11 commit 65d2bbd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

aspnetcore/performance/rate-limit-samples.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ uid: performance/rate-limit-sample
1313

1414
The following samples aren't production quality, they're examples on how to use the limiters.
1515

16-
### Limiter with `OnRejected`, `RetryAfter`, and `GlobalLimiter`
16+
## Limiter with `OnRejected`, `RetryAfter`, and `GlobalLimiter`
1717

1818
The following sample:
1919

@@ -41,13 +41,13 @@ The `SampleRateLimiterPolicy` class
4141

4242
In the preceding code, <xref:Microsoft.AspNetCore.RateLimiting.RateLimiterOptions.OnRejected> uses <xref:Microsoft.AspNetCore.RateLimiting.OnRejectedContext> to set the response status to [429 Too Many Requests](https://developer.mozilla.org/docs/Web/HTTP/Status/429). The default rejected status is [503 Service Unavailable](https://developer.mozilla.org/docs/Web/HTTP/Status/503).
4343

44-
### Limiter with authorization
44+
## Limiter with authorization
4545

4646
The following sample uses JSON Web Tokens (JWT) and creates a partition with the JWT [access token](https://github.com/dotnet/aspnetcore/blob/fd1891536f27e959d14a140ff9307b6a21191de9/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs#L152-L158). In a production app, the JWT would typically be provided by a server acting as a Security token service (STS). For local development, the dotnet [user-jwts](xref:security/authentication/jwt) command line tool can be used to create and manage app-specific local JWTs.
4747

4848
:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/middleware/rate-limit/WebRateLimitAuth/Program.cs" id="snippet_jwt":::
4949

50-
### Limiter with `ConcurrencyLimiter`, `TokenBucketRateLimiter`, and authorization
50+
## Limiter with `ConcurrencyLimiter`, `TokenBucketRateLimiter`, and authorization
5151

5252
The following sample:
5353

@@ -57,4 +57,5 @@ The following sample:
5757

5858
:::code language="csharp" source="~/../AspNetCore.Docs.Samples/fundamentals/middleware/rate-limit/WebRateLimitAuth/Program.cs" id="snippet_adm2":::
5959

60-
See [the samples repository for the complete `Program.cs`](https://github.com/dotnet/AspNetCore.Docs.Samples/blob/main/fundamentals/middleware/rate-limit/WebRateLimitAuth/Program.cs#L145,L281) file.
60+
See [the samples repository for the complete `Program.cs`](https://github.com/dotnet/AspNetCore.Docs.Samples/blob/main/fundamentals/middleware/rate-limit/WebRateLimitAuth/Program.cs#L145,L281) file.
61+

aspnetcore/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ items:
239239
uid: fundamentals/middleware/index
240240
- name: Rate limiting middleware
241241
uid: performance/rate-limit
242+
- name: Rate limiting samples
243+
uid: performance/rate-limit-sample
242244
- name: Middleware in Minimal API apps
243245
uid: fundamentals/minimal-apis/middleware
244246
- name: Test middleware

0 commit comments

Comments
 (0)