cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [06/21] cxf git commit: [CXF-6868] Returning null if Authorization is empty
Date Fri, 22 Apr 2016 02:13:14 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/41231ee4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/41231ee4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/41231ee4

Branch: refs/heads/master-jaxrs-2.1
Commit: 41231ee42d757e4852c8b076b04f18365fb4aa8a
Parents: bfc3d0a
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:55:58 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/41231ee4/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 637da3f..51d156b 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
@@ -544,11 +544,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