15 lines
457 B
C#
15 lines
457 B
C#
namespace Backend.Gateway;
|
|
|
|
public static class GatewayApplicationBuilderExtensions
|
|
{
|
|
// CORS must run before the rate limiter so that rejected requests still carry
|
|
// the headers the browser needs to surface a 429 to the client.
|
|
public static IApplicationBuilder UseApiGateway(this IApplicationBuilder app)
|
|
{
|
|
app.UseCors(GatewayServiceCollectionExtensions.CorsPolicyName);
|
|
app.UseRateLimiter();
|
|
|
|
return app;
|
|
}
|
|
}
|