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:25:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 4e7af5acf -> 717fd2c11


[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/717fd2c1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/717fd2c1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/717fd2c1

Branch: refs/heads/3.0.x-fixes
Commit: 717fd2c11a1f6c6455980100eb1270762a3a985c
Parents: 4e7af5a
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:25:35 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/717fd2c1/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