How to remove ASP.Net MVC Default HTTP Headers?

前端 未结 11 2200
自闭症患者
自闭症患者 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:44

    In Asp.Net Core you can edit the web.config files like so:

    
      
        
      
    
    

    You can remove the server header in the Kestrel options:

                .UseKestrel(c =>
                {
                    // removes the server header
                    c.AddServerHeader = false;
                }) 
    

提交回复
热议问题