2017  Kodetalk | Feedback | Privacy Policy | Terms | About

how to remove "server-header" from header metadata, when getting response from server

I am using jboss server and when any response coming from server to client the response header contains the information of server name with key "server-header". I want to remove the information from response.

I tried to write a filter from which the header can be removed but still not working. Is there any way to remove the header for hiding server name information to client.


You need not to write any filter for removing the "server-header" information from response header. You can do simple configuration in server itself.

1) Open your stanalone.xml file.

2) You will find below statement

<response-header name="server-header" header-name="Server" header-value="WildFly/10"/>

3) You need to remove the statement from xml file as well as you need to remove

<filter-ref name="server-header"/>

Once you removed all these. restart your server. And you will not get the server name information at client side.

Answer is