Main Page
 The gatekeeper of reality is
 quantified imagination.

Stay notified when site changes by adding your email address:

Your Email:

Bookmark and Share
Email Notification
.Net CORE and Response Headers
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>


About Joe