
ASP.NET Core 5 Secure Coding Cookbook
By :

Most ASP.NET Core web application features are useful, but some can be unnecessary or sometimes even harmful. Web developers must consider whether a web server or application functionality needs to be enabled in code. We need to remove some features to keep our ASP.NET Core web applications secure.
In this recipe, we are going to remove the Server
HTTP header to prevent web server information disclosure.
We will use the Online Banking app we used in the previous recipe. Using Visual Studio Code, open the sample Online Banking app folder at \Chapter07\unnecessary-features\before\OnlineBankingApp\
.
You can perform the steps in this folder to disable unnecessary features in this recipe.
Let's take a look at the steps for this recipe:
code .
Program.cs
and notice the value of one of the properties...