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 16ca5f1  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63196
16ca5f1 is described below

commit 16ca5f1371c85f37a2ea74bf90bf37486a810fe9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Mar 13 19:14:12 2019 +0000

    Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63196
    
    Provide a default (X-Forwarded-Proto) for the protocolHeader attribute
    of the RemoteIpFilter and RemoteIpValve.
---
 java/org/apache/catalina/filters/RemoteIpFilter.java | 2 +-
 java/org/apache/catalina/valves/RemoteIpValve.java   | 2 +-
 webapps/docs/changelog.xml                           | 5 +++++
 webapps/docs/config/filter.xml                       | 2 +-
 webapps/docs/config/valve.xml                        | 2 +-
 5 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java 
b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 886ef18..20b4abd 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -745,7 +745,7 @@ public class RemoteIpFilter implements Filter {
     /**
      * @see #setProtocolHeader(String)
      */
-    private String protocolHeader = null;
+    private String protocolHeader = "X-Forwarded-Proto";
 
     private String protocolHeaderHttpsValue = "https";
 
diff --git a/java/org/apache/catalina/valves/RemoteIpValve.java 
b/java/org/apache/catalina/valves/RemoteIpValve.java
index f82af32..145b095 100644
--- a/java/org/apache/catalina/valves/RemoteIpValve.java
+++ b/java/org/apache/catalina/valves/RemoteIpValve.java
@@ -420,7 +420,7 @@ public class RemoteIpValve extends ValveBase {
     /**
      * @see #setProtocolHeader(String)
      */
-    private String protocolHeader = null;
+    private String protocolHeader = "X-Forwarded-Proto";
 
     /**
      * @see #setProtocolHeaderHttpsValue(String)
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8013973..d0c9396 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -48,6 +48,11 @@
   <subsection name="Catalina">
     <changelog>
       <fix>
+        <bug>63196</bug>: Provide a default (<code>X-Forwarded-Proto</code>) 
for
+        the <code>protocolHeader</code> attribute of the
+        <code>RemoteIpFilter</code> and <code>RemoteIpValve</code>. (markt)
+      </fix>
+      <fix>
         <bug>63249</bug>: Use a consistent log level (<code>WARN</code>) when
         logging the failure to register or deregister a JMX Bean. (markt)
       </fix>
diff --git a/webapps/docs/config/filter.xml b/webapps/docs/config/filter.xml
index d486735..9e5b5fb 100644
--- a/webapps/docs/config/filter.xml
+++ b/webapps/docs/config/filter.xml
@@ -1594,7 +1594,7 @@ FINE: Request "/docs/config/manager.html" with response 
status "200"
       <attribute name="protocolHeader" required="false">
         <p>Name of the HTTP Header read by this valve that holds the protocol
         used by the client to connect to the proxy. If not specified, the
-        default of <code>null</code> is used.</p>
+        default of <code>X-Forwarded-Proto</code> is used.</p>
       </attribute>
 
       <attribute name="portHeader" required="false">
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index cc16a4e..43e4aad 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -985,7 +985,7 @@
       <attribute name="protocolHeader" required="false">
         <p>Name of the HTTP Header read by this valve that holds the protocol
         used by the client to connect to the proxy. If not specified, the
-        default of <code>null</code> is used.</p>
+        default of <code>X-Forwarded-Proto</code> is used.</p>
       </attribute>
 
       <attribute name="portHeader" required="false">


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

Reply via email to