Quantcast

Remove Server Name and Version from header

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Remove Server Name and Version from header

Sidharth Reddy
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.getServerCon
figuration();
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Remove Server Name and Version from header

Ryan Lubke-2
Please log an issue to track this.  Also, in the report, please confirm if you're using the Servlet module.

March 21, 2017 at 05:18
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.getServerCon
figuration();
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

Loading...