Skip to content

Commit

Permalink
Use HTTP 503 Service Unavailable for free plan rate limit (#6753)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin authored Feb 10, 2025
1 parent 410d370 commit 781c8ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apollo-router/src/plugins/router_limits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl PluginPrivate for RouterLimits {
.extension_code(extension_code)
.build();
Ok(RouterResponse::error_builder()
.status_code(StatusCode::TOO_MANY_REQUESTS)
.status_code(StatusCode::SERVICE_UNAVAILABLE)
.error(error)
.context(ctx)
.build()
Expand Down Expand Up @@ -158,7 +158,7 @@ mod test {
// * the third, delayed req succeeds

assert!(r1.is_ok_and(|resp| resp.response.status().is_success()));
assert!(r2.is_ok_and(|resp| resp.response.status() == StatusCode::TOO_MANY_REQUESTS));
assert!(r2.is_ok_and(|resp| resp.response.status() == StatusCode::SERVICE_UNAVAILABLE));
assert!(r3
.await
.is_ok_and(|resp| resp.response.status().is_success()));
Expand Down

0 comments on commit 781c8ad

Please sign in to comment.