Skip to content

Commit 4395ef4

Browse files
committed
Add HSTS header too.
1 parent ed14fc8 commit 4395ef4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

AzureCloudServiceSample/WebRoleSample/Global.asax.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,11 @@ protected void Application_Start()
1717
RouteConfig.RegisterRoutes(RouteTable.Routes);
1818
BundleConfig.RegisterBundles(BundleTable.Bundles);
1919
}
20+
21+
protected void Application_EndRequest(Object sender, EventArgs e)
22+
{
23+
HttpContext context = HttpContext.Current;
24+
context.Response.AddHeader("Strict-Transport-Security", "max-age=15724800;includeSubDomains");
25+
}
2026
}
2127
}

0 commit comments

Comments
 (0)