You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mi...@apache.org on 2019/07/09 19:58:06 UTC

[tomcat] branch mark-forwarded-request/8.5.x updated: Process Mark's comments

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

michaelo pushed a commit to branch mark-forwarded-request/8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/mark-forwarded-request/8.5.x by this push:
     new e0d237e  Process Mark's comments
e0d237e is described below

commit e0d237e56b32ee5089305337fa41d1a1fc1aeac5
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Tue Jul 9 16:43:41 2019 +0200

    Process Mark's comments
---
 java/org/apache/catalina/Globals.java                | 2 +-
 java/org/apache/catalina/filters/RemoteIpFilter.java | 2 +-
 java/org/apache/coyote/Constants.java                | 7 -------
 webapps/docs/changelog.xml                           | 3 ++-
 4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/catalina/Globals.java b/java/org/apache/catalina/Globals.java
index 7ce8209..b25ee32 100644
--- a/java/org/apache/catalina/Globals.java
+++ b/java/org/apache/catalina/Globals.java
@@ -205,7 +205,7 @@ public final class Globals {
      * a request which been forwarded via one or more proxies.
      */
     public static final String REQUEST_FORWARDED_ATTRIBUTE =
-            org.apache.coyote.Constants.REQUEST_FORWARDED_ATTRIBUTE;
+        "org.apache.tomcat.request.forwarded";
 
 
     public static final String ASYNC_SUPPORTED_ATTR =
diff --git a/java/org/apache/catalina/filters/RemoteIpFilter.java b/java/org/apache/catalina/filters/RemoteIpFilter.java
index 423b561..c3f5a81 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -862,7 +862,7 @@ public class RemoteIpFilter implements Filter {
                 }
             }
 
-            request.setAttribute(Globals.FORWARDED_REQUEST_ATTRIBUTE, Boolean.TRUE);
+            request.setAttribute(Globals.REQUEST_FORWARDED_ATTRIBUTE, Boolean.TRUE);
 
             if (log.isDebugEnabled()) {
                 log.debug("Incoming request " + request.getRequestURI() + " with originalRemoteAddr '" + request.getRemoteAddr()
diff --git a/java/org/apache/coyote/Constants.java b/java/org/apache/coyote/Constants.java
index 898068a..9de194d 100644
--- a/java/org/apache/coyote/Constants.java
+++ b/java/org/apache/coyote/Constants.java
@@ -111,11 +111,4 @@ public final class Constants {
      * the X-Forwarded-For HTTP header.
      */
     public static final String REMOTE_ADDR_ATTRIBUTE = "org.apache.tomcat.remoteAddr";
-
-    /**
-     * The request attribute that is set to the value of {@code Boolean.TRUE}
-     * by the RemoteIpFilter, RemoteIpValve (and other similar components) that identifies
-     * a request which been forwarded via one or more proxies.
-     */
-    public static final String REQUEST_FORWARDED_ATTRIBUTE = "org.apache.tomcat.request.forwarded";
 }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 959544a..96e89f4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -48,7 +48,8 @@
   <subsection name="Catalina">
     <changelog>
       <add>
-        <bug>63556</bug>: Mark request as forwarded in RemoteIpValve/RemoteIpFilter (michaelo)
+        <bug>63556</bug>: Mark request as forwarded in RemoteIpValve and
+        RemoteIpFilter (michaelo)
       </add>
      </changelog>
   </subsection>


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