cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [2/2] cxf git commit: [CXF-6868] Returning null if Authorization is empty
Date Tue, 19 Apr 2016 11:57:55 GMT
[CXF-6868] Returning null if Authorization is empty


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

Branch: refs/heads/3.0.x-fixes
Commit: 7f771258b6325e5e18eecd57f7fdf280056f44cc
Parents: e639ef2
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Apr 19 12:55:58 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Apr 19 12:57:30 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/transport/http/Headers.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7f771258/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
index bd8e3db..5f61dd2 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
@@ -529,11 +529,12 @@ public class Headers {
 
     public String getAuthorization() {
         if (headers.containsKey("Authorization")) {
-            List<String> authorizationLines = headers.get("Authorization"); 
-            return authorizationLines.get(0);
-        } else {
-            return null;
-        }
+            List<String> authorizationLines = headers.get("Authorization");
+            if (authorizationLines != null && !authorizationLines.isEmpty()) {
+                return authorizationLines.get(0);
+            }
+        } 
+        return null;
     }
 
     public static SimpleDateFormat getHttpDateFormat() {


Mime
View raw message