From fb8abbf3e01b132e0063986556da8c76300df711 Mon Sep 17 00:00:00 2001 From: rafsanulhasan Date: Sat, 1 Sep 2018 16:51:41 +0600 Subject: [PATCH] Used HSTS MiddleWare for Http Strict Transport Security --- src/Services/Identity/Identity.API/Startup.cs | 1 + src/Web/WebMVC/Startup.cs | 1 + src/Web/WebSPA/Startup.cs | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 3bd0bbedc..22dd039a0 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -119,6 +119,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API else { app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); } app.UseHttpsRedirection(); diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index d6b044ce7..791ff0336 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -68,6 +68,7 @@ namespace Microsoft.eShopOnContainers.WebMVC else { app.UseExceptionHandler("/Error"); + app.UseHsts(); } var pathBase = Configuration["PATH_BASE"]; diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 434ea3a97..c0c89f663 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -85,6 +85,10 @@ namespace eShopConContainers.WebSPA { app.UseDeveloperExceptionPage(); } + else + { + app.UseHsts(); + } app.UseHttpsRedirection();