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 2019/10/24 08:00:45 UTC

[tomcat] branch 8.5.x updated: Align with 9.0.x

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 321b2db  Align with 9.0.x
321b2db is described below

commit 321b2db8c87107677f707ffe6c0d48ddcbf4b3dc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Oct 24 09:59:42 2019 +0200

    Align with 9.0.x
---
 java/org/apache/coyote/http11/Http11Processor.java | 28 +++++++---------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java
index d2b8e48..e984616 100644
--- a/java/org/apache/coyote/http11/Http11Processor.java
+++ b/java/org/apache/coyote/http11/Http11Processor.java
@@ -166,19 +166,6 @@ public class Http11Processor extends AbstractProcessor {
 
 
     /**
-     * Allow a customized the server header for the tin-foil hat folks.
-     */
-    private String server = null;
-
-
-    /*
-     * Should application provider values for the HTTP Server header be removed.
-     * Note that if {@link #server} is set, any application provided value will
-     * be over-ridden.
-     */
-    private boolean serverRemoveAppProvidedValues = false;
-
-    /**
      * Instance of the new protocol to use after the HTTP connection has been
      * upgraded.
      */
@@ -426,18 +413,18 @@ public class Http11Processor extends AbstractProcessor {
      * Set the server header name.
      *
      * @param server The new value to use for the server header
+     *
+     * @deprecated Use {@link Http11Protocol#setServer(String)}
      */
+    @Deprecated
     public void setServer(String server) {
-        if (server == null || server.equals("")) {
-            this.server = null;
-        } else {
-            this.server = server;
-        }
+        protocol.setServer(server);
     }
 
 
+    @Deprecated
     public void setServerRemoveAppProvidedValues(boolean serverRemoveAppProvidedValues) {
-        this.serverRemoveAppProvidedValues = serverRemoveAppProvidedValues;
+        protocol.setServerRemoveAppProvidedValues(serverRemoveAppProvidedValues);
     }
 
 
@@ -1171,8 +1158,9 @@ public class Http11Processor extends AbstractProcessor {
         }
 
         // Add server header
+        String server = protocol.getServer();
         if (server == null) {
-            if (serverRemoveAppProvidedValues) {
+            if (protocol.getServerRemoveAppProvidedValues()) {
                 headers.removeHeader("server");
             }
         } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org