Skip to content

Commit adf5b79

Browse files
committed
Use enum value for http code
1 parent 2d33c91 commit adf5b79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Api/Setup/ApiServices.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Net;
12
using System.Text.Json;
23
using System.Text.Json.Serialization;
34
using System.Threading.RateLimiting;
@@ -106,7 +107,7 @@ public static void ConfigureServices(this IServiceCollection services)
106107

107108
opt.OnRejected = async (context, cancellationToken) =>
108109
{
109-
context.HttpContext.Response.StatusCode = 429;
110+
context.HttpContext.Response.StatusCode = (int)HttpStatusCode.TooManyRequests;
110111
await context.HttpContext.Response
111112
.WriteAsync("Too many requests. Please try again later.", cancellationToken)
112113
.ConfigureAwait(false);

0 commit comments

Comments
 (0)