Author: markt Date: Wed Jan 13 10:42:08 2010 New Revision: 898709 URL: http://svn.apache.org/viewvc?rev=898709&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48004 Allow applications to set the Server header
Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=898709&r1=898708&r2=898709&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jan 13 10:42:08 2010 @@ -183,9 +183,3 @@ http://svn.apache.org/viewvc?rev=898468&view=rev +1: markt -1: - -* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48004 - Allow applications to set the Server header - http://svn.apache.org/viewvc?rev=898527&view=rev - +1: markt, kkolinko, rjung - -1: Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=898709&r1=898708&r2=898709&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Wed Jan 13 10:42:08 2010 @@ -1696,8 +1696,10 @@ // Add server header if (server != null) { + // Always overrides anything the app might set headers.setValue("Server").setString(server); - } else { + } else if (headers.getValue("Server") == null) { + // If app didn't set the header, use the default outputBuffer.write(Constants.SERVER_BYTES); } Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=898709&r1=898708&r2=898709&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Jan 13 10:42:08 2010 @@ -1723,8 +1723,10 @@ // Add server header if (server != null) { + // Always overrides anything the app might set headers.setValue("Server").setString(server); - } else { + } else if (headers.getValue("Server") == null) { + // If app didn't set the header, use the default outputBuffer.write(Constants.SERVER_BYTES); } Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=898709&r1=898708&r2=898709&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java Wed Jan 13 10:42:08 2010 @@ -1602,8 +1602,10 @@ // Add server header if (server != null) { + // Always overrides anything the app might set headers.setValue("Server").setString(server); - } else { + } else if (headers.getValue("Server") == null) { + // If app didn't set the header, use the default outputBuffer.write(Constants.SERVER_BYTES); } Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=898709&r1=898708&r2=898709&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Jan 13 10:42:08 2010 @@ -72,6 +72,10 @@ Update recommended version for native to 1.1.19. (rjung) </update> <fix> + <bug>48004</bug>: All web applications to set the http + <code>Server</code> header. (markt) + </fix> + <fix> <bug>48470</bug>: Ensure Tomcat does not lock up if shut down under load. (markt) </fix> Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml?rev=898709&r1=898708&r2=898709&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml Wed Jan 13 10:42:08 2010 @@ -356,8 +356,12 @@ </attribute> <attribute name="server" required="false"> - <p>The Server header for the http response. - Unless you are paranoid, you won't need this feature. + <p>Overrides the Server header for the http response. If set, the value + for this attribute overrides the Tomcat default and any Server header set + by a web application. If not set, any value specified by the application + is used. If the application does not specify a value then + <code>Apache-Coyote/1.1</code> is used. Unless you are paranoid, you won't + need this feature. </p> </attribute> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org