cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6574] Making the fix complete, with thanks to Roger Talkov
Date Tue, 22 Dec 2015 11:24:05 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes d877c0539 -> b0ff0ff0b


[CXF-6574] Making the fix complete, with thanks to Roger Talkov


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

Branch: refs/heads/3.1.x-fixes
Commit: b0ff0ff0b4a53c8a10ddf4e768312136a03c1242
Parents: d877c05
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Dec 22 11:22:02 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Dec 22 11:23:46 2015 +0000

----------------------------------------------------------------------
 .../cxf/transport/http/auth/DigestAuthSupplier.java | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b0ff0ff0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
index f34cfc8..a8d6266 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
@@ -74,11 +74,7 @@ public class DigestAuthSupplier implements HttpAuthSupplier {
                 /* Preemptive authentication is only possible if we have a cached
                  * challenge
                  */
-                String authURI = currentURI.getPath();
-                if (currentURI.getQuery() != null) {
-                    authURI += '?' + currentURI.getQuery();
-                }
-                return di.generateAuth(authURI, 
+                return di.generateAuth(getAuthURI(currentURI), 
                                        authPolicy.getUserName(),
                                        authPolicy.getPassword());            
             } else {
@@ -107,7 +103,7 @@ public class DigestAuthSupplier implements HttpAuthSupplier {
                 }
                 authInfo.put(currentURI, di);
                 
-                return di.generateAuth(currentURI.getPath(), 
+                return di.generateAuth(getAuthURI(currentURI), 
                                        authPolicy.getUserName(),
                                        authPolicy.getPassword());
             }
@@ -116,6 +112,14 @@ public class DigestAuthSupplier implements HttpAuthSupplier {
         return null;
     }
 
+    private static String getAuthURI(URI currentURI) {
+        String authURI = currentURI.getPath();
+        if (currentURI.getQuery() != null) {
+            authURI += '?' + currentURI.getQuery();
+        }
+        return authURI;
+    }
+
     public String createCnonce() throws UnsupportedEncodingException {
         String cnonce = Long.toString(System.currentTimeMillis());
         byte[] bytes = cnonce.getBytes("US-ASCII");


Mime
View raw message