WCF |如何删除响应标头,如“服务器”,ASPNetVersion,“Powered”等。等等 [英] WCF | How to remove response headers like "Server", ASPNetVersion, "Powered" by etc

查看:84
本文介绍了WCF |如何删除响应标头,如“服务器”,ASPNetVersion,“Powered”等。等等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


为了安全起见,我要求我不应该披露服务器,asp.net版本等响应标头。 


如何在为WCF服务进行呼叫时限制这些标头。



我已经尝试过以下配置设置但适用于aspx页面调用但不适用于WCF服务调用。


  <?  xml version   =  " 1.0"   encoding   =  " utf-8"  ?>   
< configuration>
< system webServer >
< httpProtocol>
< customHeaders>
< remove name = "服务器" />
< remove name = "X-Powered-By" />
< remove name = " X-AspNet-Version" />
< / customHeaders >
< / httpProtocol >
< / system webServer >
< / configuration >



谢谢,


Mantesh MB

解决方案

此论坛特定于POS for .NET你可能想重新发布到WCF论坛:
https:/ /social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf

Hi all,

I have requirement where in for security reason I am not supposed to disclose response headers like server, asp.net version etc. 

How can I restrict these headers when calls are made for WCF services.

I have already tried the below config settings but works fine for aspx page calls but not for WCF service calls.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <remove name="Server" />
        <remove name="X-Powered-By" />
        <remove name="X-AspNet-Version" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

Thanks,

Mantesh M. B.

解决方案

This forum is specific for POS for .NET. You might want to repost to the WCF forum: https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf


这篇关于WCF |如何删除响应标头,如“服务器”,ASPNetVersion,“Powered”等。等等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆