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-6408] Preventing NPE
Date Tue, 19 May 2015 12:29:38 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 50b4ccf16 -> b4f34d03b


[CXF-6408] Preventing NPE


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

Branch: refs/heads/master
Commit: b4f34d03b2a244f9b97918d6ca33f532079e8dcb
Parents: 50b4ccf
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue May 19 13:29:21 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue May 19 13:29:21 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/transport/http/HTTPConduit.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b4f34d03/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
index 1cf61b9..c5f6fdd 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
@@ -1473,7 +1473,12 @@ public abstract class HTTPConduit
         protected boolean authorizationRetransmit() throws IOException {
             Message m = new MessageImpl();
             updateResponseHeaders(m);
-            HttpAuthHeader authHeader = new HttpAuthHeader(Headers.getSetProtocolHeaders(m).get("WWW-Authenticate"));
+            List<String> authHeaderValues = Headers.getSetProtocolHeaders(m).get("WWW-Authenticate");
+            if (authHeaderValues == null) {
+                LOG.warning("WWW-Authenticate response header is not set");
+                return false;
+            }
+            HttpAuthHeader authHeader = new HttpAuthHeader(authHeaderValues);
             URI currentURI = url;
             String realm = authHeader.getRealm();
             detectAuthorizationLoop(getConduitName(), outMessage, currentURI, realm);


Mime
View raw message