How to delete IIS custom headers like X-Powered-By: ASP.NET from response?

后端 未结 7 1655
小鲜肉
小鲜肉 2021-02-01 13:19

In IIS 7.0 integrated mode after deleting all headers with Response.ClearHeaders() IIS would add some other headers like Server

7条回答
  •  醉话见心
    2021-02-01 13:46

    You can add this to your Web.Config:

    
        
            
                
            
        
    
    

    Update: if you're using the MVC framework I would also recommend removing the X-AspNetMvc-Version and X-AspNet-Version headers as well. This is accomplished by setting MvcHandler.DisableMvcResponseHeader = true in your Global.asax file and in your Web.config respectively.

提交回复
热议问题