配置了严格的传输安全性,但没有';不适用于asp.NETCore2.2
我有一个.net core 2.2应用程序,它支持默认的Hsts 启动时我的配置如下:配置了严格的传输安全性,但没有';不适用于asp.NETCore2.2,asp.net,asp.net-mvc,asp.net-core,.net-core,hsts,Asp.net,Asp.net Mvc,Asp.net Core,.net Core,Hsts,我有一个.net core 2.2应用程序,它支持默认的Hsts 启动时我的配置如下: public void ConfigureServices(IServiceCollection services) { . . . var currentDate = DateTime.Now; services.AddHsts(options => { options.MaxAge =
public void ConfigureServices(IServiceCollection services)
{
.
.
.
var currentDate = DateTime.Now;
services.AddHsts(options =>
{
options.MaxAge = currentDate.AddYears(1) - currentDate;
options.IncludeSubDomains = true;
});
services.AddHttpsRedirection(options =>
{
});
.
.
.
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider
services)
{
.
.
.
app.UseHsts();
app.UseHttpsRedirection();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
我有所有这些,但当我查看我的回复标题时,我看到了
Strict-Transport-Security : disabled
应用程序部署在EC2 AWS虚拟机上,因此我不在本地检查应用程序部署在EC2 AWS虚拟机上,因此我不在本地检查应用程序