users@grizzly.java.net

Remove Server Name and Version from header

From: Sidharth Reddy <sidharth.reddy_at_flexmoney.in>
Date: Tue, 21 Mar 2017 17:48:14 +0530

Hi,

I am trying to remove the Server header from Grizzly response. By setting
response.setHeader("Server", ""); in the controller, i am able to set it to
empty string for responses from the controller.

However for any exceptions, I am unable to remove the server name from the
exception responses.

Setting the following config values

HttpServer grizzlyHttpServer = new HttpServer()
ServerConfiguration config = grizzlyHttpServer.getServerConfiguration();
config.setHttpServerName("");
config.setHttpServerVersion("");

removes the server name from the title tag in the response html. However
the server header is still present and shows as grizzly/2.3.24


Any guidance on how to remove this from the exception headers will be
greatly appreciated.

Thanks,
Sid