diff --git a/DeviceFlowWeb/Program.cs b/DeviceFlowWeb/Program.cs index 7eabbe5..9710c68 100644 --- a/DeviceFlowWeb/Program.cs +++ b/DeviceFlowWeb/Program.cs @@ -6,13 +6,12 @@ var services = builder.Services; var configuration = builder.Configuration; -var env = builder.Environment; services.AddSecurityHeaderPolicies() .SetPolicySelector((PolicySelectorContext ctx) => { return SecurityHeadersDefinitions - .GetHeaderPolicyCollection(env.IsDevelopment()); + .GetHeaderPolicyCollection(builder.Environment.IsDevelopment()); }); services.AddScoped(); @@ -50,7 +49,7 @@ app.UseSecurityHeaders(); -if (env.IsDevelopment()) +if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); }