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

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


The following commit(s) were added to refs/heads/7.0.x by this push:
     new 8564f1d  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63196
8564f1d is described below

commit 8564f1d530e495e57cf550db49140d0cff416b31
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 e20f53b..d52bba9 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -727,7 +727,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 f2b1a23..5b9e921 100644
--- a/java/org/apache/catalina/valves/RemoteIpValve.java
+++ b/java/org/apache/catalina/valves/RemoteIpValve.java
@@ -422,7 +422,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 0cc0c15..b7808c1 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -85,6 +85,11 @@
         calling <code>AsyncContext.dispatch()</code>. (markt)
       </fix>
       <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 8a52706..598e7a8 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 b93cfd6..9c16436 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -896,7 +896,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