You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started using your Nuget: "AspNetCoreRateLimit", which controls the maximum number of requests to a certain API or to all APIs.
After the desired number of requests, the API is indeed blocked.
for 3 requests I indeed see 429 as response status, but after the 3rd request and so on, I stop getting a 429 status and start getting a CORS error.
Do you have any idea why this is happening?
The text was updated successfully, but these errors were encountered:
To resolve the CORS issue you're experiencing after hitting the rate limit, you can try applying the CORS middleware globally before the rate-limiting middleware. Here’s how you can configure it:
// Apply CORS globally before any other middlewareapp.UseCors("AllowAllOrigins");// Apply the rate limiting middlewareapp.UseIpRateLimiting();app.UseRouting();// ...
This approach ensures that even when a 429 status code is returned, the CORS headers are correctly included. However, this is just my method—I’m not sure if it fits your scenario, but I hope it helps!
Hello,
I started using your Nuget: "AspNetCoreRateLimit", which controls the maximum number of requests to a certain API or to all APIs.
After the desired number of requests, the API is indeed blocked.
for 3 requests I indeed see 429 as response status, but after the 3rd request and so on, I stop getting a 429 status and start getting a CORS error.
Do you have any idea why this is happening?
The text was updated successfully, but these errors were encountered: