0

I read this link How to Implement HSTS header in ASP.Net Core 6.0? which adds HSTS via the program.cs file.

I read https://learn.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-7.0&tabs=visual-studio%2Clinux-ubuntu but no indication of adding it via the config file.

Is it possible to set HSTS via the config file (appSettings.json or xxxx.json) rather than adding it programmatically?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Computer
  • 2,149
  • 7
  • 34
  • 71
  • Maybe not. If you put some values in `appsettings.json`, in `Program.cs` you still need to read the values and add them. – Chen Apr 28 '23 at 08:18

0 Answers0