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:22:19 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 7f189cae2 -> f811aead6


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

Branch: refs/heads/master
Commit: f811aead66edb0ba24ddd15b734f679d5b67a6c6
Parents: 7f189ca
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:22:02 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/f811aead/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