svn commit: r1848321 - /tomcat/trunk/java/org/apache/catalina/valves/RemoteIpValve.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1848321 - /tomcat/trunk/java/org/apache/catalina/valves/RemoteIpValve.java

markt
Author: markt
Date: Thu Dec  6 14:33:50 2018
New Revision: 1848321

URL: http://svn.apache.org/viewvc?rev=1848321&view=rev
Log:
Remove out of date comments

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/RemoteIpValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/RemoteIpValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/RemoteIpValve.java?rev=1848321&r1=1848320&r2=1848321&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/RemoteIpValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/RemoteIpValve.java Thu Dec  6 14:33:50 2018
@@ -621,8 +621,6 @@ public class RemoteIpValve extends Valve
                 request.setRemoteAddr(remoteIp);
                 request.setRemoteHost(remoteIp);
 
-                // use request.coyoteRequest.mimeHeaders.setValue(str).setString(str) because request.addHeader(str, str) is no-op in Tomcat
-                // 6.0
                 if (proxiesHeaderValue.size() == 0) {
                     request.getCoyoteRequest().getMimeHeaders().removeHeader(proxiesHeader);
                 } else {
@@ -644,15 +642,11 @@ public class RemoteIpValve extends Valve
                     // of the request
                 } else if (isForwardedProtoHeaderValueSecure(protocolHeaderValue)) {
                     request.setSecure(true);
-                    // use request.coyoteRequest.scheme instead of request.setScheme() because request.setScheme() is no-op in Tomcat 6.0
                     request.getCoyoteRequest().scheme().setString("https");
-
                     setPorts(request, httpsServerPort);
                 } else {
                     request.setSecure(false);
-                    // use request.coyoteRequest.scheme instead of request.setScheme() because request.setScheme() is no-op in Tomcat 6.0
                     request.getCoyoteRequest().scheme().setString("http");
-
                     setPorts(request, httpServerPort);
                 }
             }
@@ -686,15 +680,11 @@ public class RemoteIpValve extends Valve
         } finally {
             request.setRemoteAddr(originalRemoteAddr);
             request.setRemoteHost(originalRemoteHost);
-
             request.setSecure(originalSecure);
-
-            MimeHeaders headers = request.getCoyoteRequest().getMimeHeaders();
-            // use request.coyoteRequest.scheme instead of request.setScheme() because request.setScheme() is no-op in Tomcat 6.0
             request.getCoyoteRequest().scheme().setString(originalScheme);
-
             request.setServerPort(originalServerPort);
 
+            MimeHeaders headers = request.getCoyoteRequest().getMimeHeaders();
             if (originalProxiesHeader == null || originalProxiesHeader.length() == 0) {
                 headers.removeHeader(proxiesHeader);
             } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]