locked
WCF | How to remove response headers like "Server", ASPNetVersion, "Powered" by etc RRS feed

  • Question

  • 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.

    Friday, August 7, 2015 9:10 AM

All replies