how to hide it in Aspx mvc and dot net frame work all Response header and Request header like js version and appversion bootstrap version etc

how to hide it in Aspx mvc and dot net frame work all Response header and Request header like js version and appversion bootstrap version etc

Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Saravanan GanesanPosted Sep 24, 2023, 5:24 PM
To hide specific headers like JavaScript version, app version, and others in an ASP.NET MVC application using .NET Framework, you can use the
httpProtocolelement in theweb.configfile to remove or modify headers. For example:This configuration removes specific headers from the HTTP response, enhancing security and privacy. Adjust as needed for your requirements.
Nitin KumarPosted Sep 19, 2023, 9:02 AM
To remove unnecessary headers, such as the "Server" header, you can add the following configuration to your
web.configfile:This configuration tells IIS to remove the "Server" header from all responses sent by your application.
You can configure security headers in your ASP.NET MVC application to enhance security. Here's an example of adding a Content Security Policy (CSP) header to your
web.config:This CSP header example restricts the sources from which scripts can be loaded to the same origin ("self") and allows inline scripts and eval. Adjust the CSP policy according to your application's requirements.
Remember that security headers should be tailored to your specific security needs, and you may want to consider adding additional headers like Strict Transport Security (HSTS) and X-Content-Type-Options as needed.
By adding these configurations to your
web.configfile, you can control response headers and improve the security of your ASP.NET MVC application. Be sure to test your application thoroughly after making these changes to ensure that it functions as expected.