Closed sarahhachouche1 closed 5 months ago
I want to map response of rate limit quota into exception,
`app.UseSwaggerForOcelotUI(opt => { var serverOcelot = Configuration["ServerOcelot"]; // Could be replaced by a non existing functionality https://github.com/dotnet/aspnetcore/issues/5898 opt.PathToSwaggerGenerator = "/swagger/docs"; opt.DownstreamSwaggerEndPointBasePath = $"{serverOcelot}/swagger/docs"; opt.ReConfigureUpstreamSwaggerJson = AlterUpsteamSwaggeerJson; opt.ServerOcelot = $"{serverOcelot}"; }) .UseOcelot() .Wait();
app.Use(async (context, next) => { await next(context);
if (context.Response.StatusCode == 429) { throw new RateLimitException("Rate limit exceed"); }
});` but its not even reaching my startup.cs any insight how to do so
I want to map response of rate limit quota into exception,
`app.UseSwaggerForOcelotUI(opt => { var serverOcelot = Configuration["ServerOcelot"]; // Could be replaced by a non existing functionality https://github.com/dotnet/aspnetcore/issues/5898 opt.PathToSwaggerGenerator = "/swagger/docs"; opt.DownstreamSwaggerEndPointBasePath = $"{serverOcelot}/swagger/docs"; opt.ReConfigureUpstreamSwaggerJson = AlterUpsteamSwaggeerJson; opt.ServerOcelot = $"{serverOcelot}"; }) .UseOcelot() .Wait();
app.Use(async (context, next) => { await next(context);
});` but its not even reaching my startup.cs any insight how to do so