dotnet / dotnet/aspnetcore

Rate limiting success handler

Open
#63,932 0 comments 0 reactions 0 assignees View on GitHub
area-middleware feature-rate-limit
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I am wanting to implement rate limiting in my project and would like to be able to expose the rate limit information via headers, similar to how other [actual APIs](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28) do it.

### Describe the solution you'd like

Looking at the existing code, an API similar to the `OnRejected` but to be called when successful could enable this. These headers could actually be applied regardless of success or otherwise.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing rate-limiting OnRejected handler and its surrounding implementation; the issue names no files or tests. Determine where a successful-request hook and rate-limit headers belong, then confirm the API shape and expected behavior with maintainers before implementation. Done means the design and resulting behavior are documented and covered by relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.