You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2016/07/12 04:44:31 UTC

svn commit: r1752242 - /felix/trunk/http/sslfilter/src/main/java/org/apache/felix/http/sslfilter/internal/SslFilterRequest.java

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;
-    }    
+    }
 }