You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2016/04/07 13:25:34 UTC

[1/2] cxf git commit: Using equals instead of matches

Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 3f4457435 -> 8cfbd97e0


Using equals instead of matches


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c57a949a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c57a949a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c57a949a

Branch: refs/heads/3.1.x-fixes
Commit: c57a949a2eeff2152162cb3927e075b57480e89e
Parents: 3f44574
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Apr 7 11:50:46 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Thu Apr 7 11:52:01 2016 +0100

----------------------------------------------------------------------
 .../apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c57a949a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java
index 457beae..1416dd4 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java
@@ -134,7 +134,7 @@ public class OAuthRequestFilter extends AbstractAccessTokenValidator
       
         if (accessTokenV.getClientIpAddress() != null) {
             String remoteAddress = getMessageContext().getHttpServletRequest().getRemoteAddr();
-            if (remoteAddress == null || accessTokenV.getClientIpAddress().matches(remoteAddress)) {
+            if (remoteAddress == null || accessTokenV.getClientIpAddress().equals(remoteAddress)) {
                 String message = "Client IP Address is invalid";
                 LOG.warning(message);
                 throw ExceptionUtils.toForbiddenException(null, null);


[2/2] cxf git commit: Close a socket

Posted by co...@apache.org.
Close a socket


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8cfbd97e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8cfbd97e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8cfbd97e

Branch: refs/heads/3.1.x-fixes
Commit: 8cfbd97e0e394dca4f67b4d9bef92380f839f23b
Parents: c57a949
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Apr 7 11:50:54 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Thu Apr 7 11:52:02 2016 +0100

----------------------------------------------------------------------
 .../jaxrs/JAXRSClientServerSpringBookTest.java  | 35 ++++++++++----------
 1 file changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8cfbd97e/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
index f15c640..5994269 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
@@ -785,24 +785,25 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest
     @Test
     public void testRetrieveBookAegis3() throws Exception {
         
-        Socket s = new Socket("localhost", Integer.parseInt(PORT));
-        
-        InputStream is = this.getClass().getResourceAsStream("resources/retrieveRequest.txt");
-        byte[] bytes = IOUtils.readBytesFromStream(is);
-        s.getOutputStream().write(bytes);
-        s.getOutputStream().flush();
-        
-        BufferedReader r = new BufferedReader(new InputStreamReader(s.getInputStream()));
-        StringBuilder sb = new StringBuilder();
-        String str = null;
-        while ((str = r.readLine()) != null) {
-            sb.append(str);
-        }
+        try (Socket s = new Socket("localhost", Integer.parseInt(PORT));
+            InputStream is = this.getClass().getResourceAsStream("resources/retrieveRequest.txt")) {
+        
+            byte[] bytes = IOUtils.readBytesFromStream(is);
+            s.getOutputStream().write(bytes);
+            s.getOutputStream().flush();
+        
+            BufferedReader r = new BufferedReader(new InputStreamReader(s.getInputStream()));
+            StringBuilder sb = new StringBuilder();
+            String str = null;
+            while ((str = r.readLine()) != null) {
+                sb.append(str);
+            }
         
-        String aegisData = sb.toString();
-        s.getInputStream().close();
-        s.close();
-        assertTrue(aegisData.contains("CXF in Action - 2"));
+            String aegisData = sb.toString();
+            s.getInputStream().close();
+            s.close();
+            assertTrue(aegisData.contains("CXF in Action - 2"));
+        }
         
     }