OpenTouryoProject / OpenTouryo

”Open棟梁”は、長年の.NETアプリケーション開発実績にて蓄積したノウハウに基づき開発した.NET用アプリケーション フレームワークです。 (”OpenTouryo” , is an application framework for .NET which was developed using the accumulated know-how with a long track record in .NET application development.)
https://opentouryo.osscons.jp
240 stars 55 forks source link

UseHttpsRedirection and UseHsts methods should be called in !IsDevelopment conditional branch. #410

Closed daisukenishino2 closed 3 years ago

daisukenishino2 commented 3 years ago

Requirement

 if (env.IsDevelopment())
 {
     app.UseDeveloperExceptionPage();
 }
 else
 {
     app.UseExceptionHandler("/Home/Error");

     // The default HSTS value is 30 days.
     // You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
     app.UseHsts();
 }

 // HttpContextのマイグレーション用
 app._UseHttpContextAccessor();

 app.UseHttpsRedirection();

↓ ↓ ↓

 if (env.IsDevelopment())
 {
     app.UseDeveloperExceptionPage();
 }
 else
 {
     app.UseExceptionHandler("/Home/Error");

     // The default HSTS value is 30 days.
     // You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
     app.UseHsts();
     //app.UseHttpsRedirection();
 }

 // HttpContextのマイグレーション用
 app._UseHttpContextAccessor();