You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/01/12 22:36:50 UTC
svn commit: r898527 - in /tomcat/trunk:
java/org/apache/coyote/http11/Http11AprProcessor.java
java/org/apache/coyote/http11/Http11NioProcessor.java
java/org/apache/coyote/http11/Http11Processor.java
webapps/docs/config/http.xml
Author: markt
Date: Tue Jan 12 21:36:49 2010
New Revision: 898527
URL: http://svn.apache.org/viewvc?rev=898527&view=rev
Log:
Fix bug 48004. Allow applications to set the server header.
Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
tomcat/trunk/webapps/docs/config/http.xml
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=898527&r1=898526&r2=898527&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Tue Jan 12 21:36:49 2010
@@ -1688,8 +1688,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/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=898527&r1=898526&r2=898527&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Tue Jan 12 21:36:49 2010
@@ -1187,8 +1187,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/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=898527&r1=898526&r2=898527&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Tue Jan 12 21:36:49 2010
@@ -855,8 +855,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/trunk/webapps/docs/config/http.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=898527&r1=898526&r2=898527&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Tue Jan 12 21:36:49 2010
@@ -364,8 +364,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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org