How to remove ASP.Net MVC Default HTTP Headers?

前端 未结 11 2187
自闭症患者
自闭症患者 2020-11-28 01:23

Each page in an MVC application I\'m working with sets these HTTP headers in responses:

X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
X-AspNetMvc-Version         


        
11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 01:36

    As shown on Removing standard server headers on Windows Azure Web Sites page, you can remove headers with the following:

    
    
      
        
          
            
          
        
        
          
        
      
      
        
      
    
    

    This removes the Server header, and the X- headers.

    This worked locally in my tests in Visual Studio 2015.

提交回复
热议问题