Skip to content

Commit

Permalink
Merge pull request #353 from DFE-Digital/disable-rate-limiting-in-pro…
Browse files Browse the repository at this point in the history
…duction-like-environments

Disable rate limiting in Staging environments
  • Loading branch information
ethax-ross authored Nov 3, 2020
2 parents c441ef3 + 7654e4c commit f271b13
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions GetIntoTeachingApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,14 @@ public void ConfigureServices(IServiceCollection services)
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment hostEnv)
{
app.UseClientRateLimiting();

using var serviceScope = app.ApplicationServices.CreateScope();
var env = serviceScope.ServiceProvider.GetService<IEnv>();

if (!env.IsStaging)
{
app.UseClientRateLimiting();
}

if (hostEnv.IsDevelopment())
{
app.UseDeveloperExceptionPage();
Expand Down

0 comments on commit f271b13

Please sign in to comment.