Reputation: 1973
Is there a way to not displaying the header fileds of http response.
For example :
HTTP/1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
Content-Length: 88
Content-Type: text/html
Connection: Closed
The field Server may be a bad practice when it is shown. I thought there were a production mode for tomcat with an ability to hide some header fields.
Upvotes: 0
Views: 1785
Reputation: 320
In your server.xml file, add server="___"
to the connector to change the header name. I believe just ""
will remove the header or send a blank, but I'm not positive.
So your connectors will look something like this:
<Connector port="8080"
protocol="HTTP/1.1"
connectionTimeout="20000"
server="Not Tomcat">
Note that I had problems when changing this on a development machine. I decided it was a problem with Netbeans looking for the default header and complaining about the server not running when the server setting was anything but the default. But it works great on the production servers.
But... It looks like you're using an Apache httpd server, since the default Tomcat server header is "Apache-Coyote/1.1", at least for 8.0.38. I don't know if changing that in the Tomcat back end will make it past the Apache server.
Upvotes: 1