Skip to content

Why does rate limiting throw HTTP 500 by default instead of HTTP 429? #58768

Answered by gfoidl
sander1095 asked this question in Q&A
Discussion options

You must be logged in to vote

By defaults it's HTTP 503 (

public int RejectionStatusCode { get; set; } = StatusCodes.Status503ServiceUnavailable;
)

HTTP 429 is for a specific client, whilst HTTP 503 is more "general". The framework can't know if it's client specific or not (depends on configuration of the rate limiter), thus 503 is used -- and therefore it's also configurable to set HTTP 429 if one knows it's client specific.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sander1095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
feature-rate-limit Work related to use of rate limit primitives area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
2 participants