Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Last active June 30, 2020 09:01
Show Gist options
  • Select an option

  • Save PradeepLoganathan/0285fbdaabdf5e195a675e2f7f855725 to your computer and use it in GitHub Desktop.

Select an option

Save PradeepLoganathan/0285fbdaabdf5e195a675e2f7f855725 to your computer and use it in GitHub Desktop.
Adding HSTS to the middleware pipeline
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddHsts(options =>
{
options.Preload = true;
options.IncludeSubDomains = true;
options.MaxAge = TimeSpan.FromDays(365);
});
//....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment