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 14:43:49 UTC
[tomcat] branch mark-forwarded-request/9.0.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/9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/mark-forwarded-request/9.0.x by this push:
new 38139bc Process Mark's comments
38139bc is described below
commit 38139bcfe3fdf2a1a5f511e391b3c251c692cf0c
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 bf6431b..1afe033 100644
--- a/java/org/apache/catalina/filters/RemoteIpFilter.java
+++ b/java/org/apache/catalina/filters/RemoteIpFilter.java
@@ -822,7 +822,7 @@ public class RemoteIpFilter extends GenericFilter {
}
}
- 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 6b264e3..1475ba7 100644
--- a/java/org/apache/coyote/Constants.java
+++ b/java/org/apache/coyote/Constants.java
@@ -96,11 +96,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 d95f6c1..2e7a08b 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