felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1752242 - /felix/trunk/http/sslfilter/src/main/java/org/apache/felix/http/sslfilter/internal/SslFilterRequest.java
Date Tue, 12 Jul 2016 04:44:31 GMT
Author: cziegeler
Date: Tue Jul 12 04:44:31 2016
New Revision: 1752242

URL: http://svn.apache.org/viewvc?rev=1752242&view=rev
Log:
FELIX-5287 : [SSLFilter] use Integer.parseInt instead of Integer.valueOf. Apply patch from
Jörg Hoh

Modified:
    felix/trunk/http/sslfilter/src/main/java/org/apache/felix/http/sslfilter/internal/SslFilterRequest.java

Modified: felix/trunk/http/sslfilter/src/main/java/org/apache/felix/http/sslfilter/internal/SslFilterRequest.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/sslfilter/src/main/java/org/apache/felix/http/sslfilter/internal/SslFilterRequest.java?rev=1752242&r1=1752241&r2=1752242&view=diff
==============================================================================
--- felix/trunk/http/sslfilter/src/main/java/org/apache/felix/http/sslfilter/internal/SslFilterRequest.java
(original)
+++ felix/trunk/http/sslfilter/src/main/java/org/apache/felix/http/sslfilter/internal/SslFilterRequest.java
Tue Jul 12 04:44:31 2016
@@ -49,7 +49,7 @@ class SslFilterRequest extends HttpServl
     SslFilterRequest(HttpServletRequest request, String clientCertHeader) throws CertificateException
     {
         super(request);
-        
+
         // TODO jawi: perhaps we should make this class a little smarter wrt the given request:
         // it now always assumes it should rewrite its URL, while this might not always be
the
         // case...
@@ -80,20 +80,23 @@ class SslFilterRequest extends HttpServl
         getRequest().removeAttribute(ATTR_SSL_CERTIFICATE);
     }
 
+    @Override
     public String getScheme()
     {
         return HTTPS;
     }
 
+    @Override
     public boolean isSecure()
     {
         return true;
     }
 
+    @Override
     public StringBuffer getRequestURL()
     {
         StringBuffer tmp = new StringBuffer(super.getRequestURL());
-        // In case the request happened over http, simply insert an additional 's' 
+        // In case the request happened over http, simply insert an additional 's'
         // to make the request appear to be done over https...
         if (tmp.indexOf(HTTP_SCHEME_PREFIX) == 0)
         {
@@ -101,15 +104,16 @@ class SslFilterRequest extends HttpServl
         }
         return tmp;
     }
-    
-    public int getServerPort() 
+
+    @Override
+    public int getServerPort()
     {
         int port;
-        
+
         try
-        {            
+        {
             String fwdPort = getHeader(HDR_X_FORWARDED_PORT);
-            port = Integer.valueOf(fwdPort);
+            port = Integer.parseInt(fwdPort);
         }
         catch (Exception e)
         {
@@ -117,5 +121,5 @@ class SslFilterRequest extends HttpServl
             port = getRequest().getServerPort();
         }
         return port;
-    }    
+    }
 }



Mime
View raw message