Author: markt Date: Wed Mar 3 23:31:31 2010 New Revision: 918772 URL: http://svn.apache.org/viewvc?rev=918772&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48004 Allow applications to set the Server header
Modified: tomcat/tc5.5.x/trunk/STATUS.txt tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml tomcat/tc5.5.x/trunk/container/webapps/docs/config/http.xml Modified: tomcat/tc5.5.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=918772&r1=918771&r2=918772&view=diff ============================================================================== --- tomcat/tc5.5.x/trunk/STATUS.txt (original) +++ tomcat/tc5.5.x/trunk/STATUS.txt Wed Mar 3 23:31:31 2010 @@ -100,12 +100,6 @@ +1: markt, rjung -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: - * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48581 Avoid security exception on first access http://people.apache.org/~markt/patches/2010-02-02-bug48581.patch Modified: tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=918772&r1=918771&r2=918772&view=diff ============================================================================== --- tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java (original) +++ tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java Wed Mar 3 23:31:31 2010 @@ -1659,8 +1659,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/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java?rev=918772&r1=918771&r2=918772&view=diff ============================================================================== --- tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java (original) +++ tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java Wed Mar 3 23:31:31 2010 @@ -1617,8 +1617,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/tc5.5.x/trunk/container/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=918772&r1=918771&r2=918772&view=diff ============================================================================== --- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original) +++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Wed Mar 3 23:31:31 2010 @@ -116,6 +116,9 @@ with RFC2616. (markt/kkolinko) </fix> <fix> + <bug>48004</bug>: Allow applications to set the Server header. (markt) + </fix> + <fix> <bug>48049</bug>: Fix copy and paste error so <code>NamingContext.destroySubContext()</code> works correctly. Patch provided by gingyang.xu (markt) Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/config/http.xml?rev=918772&r1=918771&r2=918772&view=diff ============================================================================== --- tomcat/tc5.5.x/trunk/container/webapps/docs/config/http.xml (original) +++ tomcat/tc5.5.x/trunk/container/webapps/docs/config/http.xml Wed Mar 3 23:31:31 2010 @@ -326,8 +326,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