IIRC, this will handle the error page body but not the server header. The Connectors are pretty stringent on not being change in 5.0.x.

You'll need to change org.apache.coyote.http11.Constants

Here is the code which you'll change:
/**
 * Server string.
 */
public static final byte[] SERVER_BYTES =
    ByteChunk.convertToBytes("Server: Apache-Coyote/1.1" + CRLF);

===========================================
If one is using the Http11Processor.java (in org.apache.coyote.http11) then the following patch would also work (and be easier than a compile time setting - since you can config server on the fly):

outputBuffer.sendStatus();

/*CHANGED CODE AROUND LINE 1618 */
if (headers.findHeader("Server", 0)==-1) {
    outputBuffer.write(Constants.SERVER_BYTES);
}
/*END CHANGED CODE AROUND LINE 1618 */

int size = headers.size();
for (int i = 0; i < size; i++) {
    outputBuffer.sendHeader(headers.getName(i), headers.getValue(i));
}
outputBuffer.endHeaders();


-Tim

Mark Thomas wrote:
Nishant Kavi wrote:
Hello all,

Is there any way one can turn off header information (tomcat/5.0.25, 
coyote/1.1)?

There is no way to do this in 5.0.25 via configuration but what you
can do in this version is:
 - find $CATALINA_HOME/server/lib/catalina.jar
 - extract the contents of the jar to a temporary directory
 - find org/apache/catalina/util/ServerInfo.properties
 - open this file
 - edit the server.info property
 - save the file
 - rebuild the jar
 - replace the original catalina.jar with your modified version

In the latest 5.5.x and 6.0.x there is a connector property (server)
you can set.

However you approach this, you will need to restart Tomcat before the
change takes effect.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to