Purpose
The purpose of this tutorial is to show an example of both how to restrict response headers as well as create response headers. The quickest way to accomplish that is to add a web.config to the root folder of the .Net CORE project.
web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering removeServerHeader="true" />
</security>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
<remove name="X-AspNet-Version" />
<remove name="X-AspNetMvc-Version" />
<add name="Cache-Control" value="no-cache, no-store, max-age=0" />
<add name="Pragma" value="no-cache" />
<add name="Expires" value="-1" />
<add name="X-Content-Type-Options" value="nosniff" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>