Most likely you do not want these headers to be displayed in your responses:
- Server Microsoft-IIS/7.5
- X-AspNetMvc-Version 4.0
- X-AspNet-Version 4.0.303319
- X-Powered-By ASP.NET
Removing X-AspNet-Version, In web.config add this:
<system.web> <httpRuntime enableVersionHeader="false"/> </system.web>
Removing X-AspNetMvc-Version, In global.asax.cs add this:
protected void Application_Start() { MvcHandler.DisableMvcResponseHeader = true; }
Removing or changing X-Powered-By, IIS 7.5 - You can also remove the X-Powered-By header by including these lines to the
<system.webServer> <httpProtocol> <customHeaders> <clear /> <remove name="X-Powered-By" /> </customHeaders> </httpProtocol> </system.webServer>
Removing Server, In global.asax.cs add this:
protected void Application_PreSendRequestHeaders() { Response.Headers.Remove("Server"); }
No comments :
Post a Comment