如何移除响应头中的.net framework 版本信息 以及mvc版本信息?
先来看一个简单mvc3网站的响应头
修改Global.asax文件
在Application_Start方法中添加如下代码
MvcHandler.DisableMvcResponseHeader = true;
修改Web.config
在system.web配置节中增加如下配置
<httpRuntime enableVersionHeader="false"/>
再次查看响应头

在Application_Start方法中添加如下代码
MvcHandler.DisableMvcResponseHeader = true;
在system.web配置节中增加如下配置
<httpRuntime enableVersionHeader="false"/>