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:31:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 3665c9e05 -> 129aa76de


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

Branch: refs/heads/2.7.x-fixes
Commit: 129aa76deb1356e8927d5273f0dfcdd8c9f251e7
Parents: 3665c9e
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:31:30 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/129aa76d/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 cb2f727..4c14abf 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
@@ -1465,7 +1465,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