1. <i id='luRA9'><tr id='luRA9'><dt id='luRA9'><q id='luRA9'><span id='luRA9'><b id='luRA9'><form id='luRA9'><ins id='luRA9'></ins><ul id='luRA9'></ul><sub id='luRA9'></sub></form><legend id='luRA9'></legend><bdo id='luRA9'><pre id='luRA9'><center id='luRA9'></center></pre></bdo></b><th id='luRA9'></th></span></q></dt></tr></i><div id='luRA9'><tfoot id='luRA9'></tfoot><dl id='luRA9'><fieldset id='luRA9'></fieldset></dl></div>

        <legend id='luRA9'><style id='luRA9'><dir id='luRA9'><q id='luRA9'></q></dir></style></legend>
      2. <small id='luRA9'></small><noframes id='luRA9'>

          <bdo id='luRA9'></bdo><ul id='luRA9'></ul>
      3. <tfoot id='luRA9'></tfoot>

        如何从响应中删除 IIS 自定义标头,例如 X-Powered-By: ASP.NET?

        How to delete IIS custom headers like X-Powered-By: ASP.NET from response?(如何从响应中删除 IIS 自定义标头,例如 X-Powered-By: ASP.NET?)
      4. <i id='Hmb4s'><tr id='Hmb4s'><dt id='Hmb4s'><q id='Hmb4s'><span id='Hmb4s'><b id='Hmb4s'><form id='Hmb4s'><ins id='Hmb4s'></ins><ul id='Hmb4s'></ul><sub id='Hmb4s'></sub></form><legend id='Hmb4s'></legend><bdo id='Hmb4s'><pre id='Hmb4s'><center id='Hmb4s'></center></pre></bdo></b><th id='Hmb4s'></th></span></q></dt></tr></i><div id='Hmb4s'><tfoot id='Hmb4s'></tfoot><dl id='Hmb4s'><fieldset id='Hmb4s'></fieldset></dl></div>
        1. <tfoot id='Hmb4s'></tfoot>
        2. <small id='Hmb4s'></small><noframes id='Hmb4s'>

                <tbody id='Hmb4s'></tbody>
                <bdo id='Hmb4s'></bdo><ul id='Hmb4s'></ul>

                <legend id='Hmb4s'><style id='Hmb4s'><dir id='Hmb4s'><q id='Hmb4s'></q></dir></style></legend>
                  本文介绍了如何从响应中删除 IIS 自定义标头,例如 X-Powered-By: ASP.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  IIS 7.0 集成模式 使用 Response.ClearHeaders() 删除所有标头后,IIS 会添加一些其他标头,例如 ServerX-Powered-By 向黑客揭示了好的信息.我怎样才能停止这种行为(考虑我仍然需要添加我的自定义标题)?

                  In IIS 7.0 integrated mode after deleting all headers with Response.ClearHeaders() IIS would add some other headers like Server and X-Powered-By which reveals good information to hackers. How can I stop this behavior (consider I still need to add my custom headers) ?

                  推荐答案

                  您可以将其添加到您的 Web.Config:

                  You can add this to your Web.Config:

                  <system.webServer>
                      <httpProtocol>
                          <customHeaders>
                              <remove name="X-Powered-By" />
                          </customHeaders>
                      </httpProtocol>
                  </system.webServer>
                  

                  更新:如果您使用的是 MVC 框架,我还建议您删除 X-AspNetMvc-VersionX-AspNet-Version 标头.这是通过在 Global.asax 文件中设置 MvcHandler.DisableMvcResponseHeader = true<system.web><httpRuntime enableVersionHeader="false"/></system.web> 在你的 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 <system.web><httpRuntime enableVersionHeader="false" /></system.web> in your Web.config respectively.

                  这篇关于如何从响应中删除 IIS 自定义标头,例如 X-Powered-By: ASP.NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding HTTP Headers and Post data in a System.Windows.Forms.WebBrowser(在 System.Windows.Forms.WebBrowser 中添加 HTTP 标头和发布数据)
                  Adding headers in ASP.NET MVC 3(在 ASP.NET MVC 3 中添加标头)
                  Response.Redirect strips Header Referrer - Possible to Add it Back?(Response.Redirect 剥离 Header Referrer - 可以将其添加回来吗?)
                  Add Custom Headers using HttpWebRequest(使用 HttpWebRequest 添加自定义标头)
                  Faking browser request in ASP.net C#(在 ASP.net C# 中伪造浏览器请求)
                  System.Net.WebClient request gets 403 Forbidden but browsers do not with Apache servers(System.Net.WebClient 请求获得 403 Forbidden 但浏览器不使用 Apache 服务器)
                      <tbody id='DMd4K'></tbody>
                    • <bdo id='DMd4K'></bdo><ul id='DMd4K'></ul>

                      1. <i id='DMd4K'><tr id='DMd4K'><dt id='DMd4K'><q id='DMd4K'><span id='DMd4K'><b id='DMd4K'><form id='DMd4K'><ins id='DMd4K'></ins><ul id='DMd4K'></ul><sub id='DMd4K'></sub></form><legend id='DMd4K'></legend><bdo id='DMd4K'><pre id='DMd4K'><center id='DMd4K'></center></pre></bdo></b><th id='DMd4K'></th></span></q></dt></tr></i><div id='DMd4K'><tfoot id='DMd4K'></tfoot><dl id='DMd4K'><fieldset id='DMd4K'></fieldset></dl></div>

                        <small id='DMd4K'></small><noframes id='DMd4K'>

                        <tfoot id='DMd4K'></tfoot><legend id='DMd4K'><style id='DMd4K'><dir id='DMd4K'><q id='DMd4K'></q></dir></style></legend>