Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A2EF4183C8 for ; Tue, 19 Apr 2016 11:57:54 +0000 (UTC) Received: (qmail 67027 invoked by uid 500); 19 Apr 2016 11:57:54 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 66896 invoked by uid 500); 19 Apr 2016 11:57:54 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 66886 invoked by uid 99); 19 Apr 2016 11:57:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Apr 2016 11:57:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 11FEEDFFA9; Tue, 19 Apr 2016 11:57:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Date: Tue, 19 Apr 2016 11:57:55 -0000 Message-Id: In-Reply-To: <433a94f55edf454b87902aa26a34e5e9@git.apache.org> References: <433a94f55edf454b87902aa26a34e5e9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] cxf git commit: [CXF-6868] Returning null if Authorization is empty [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 Authored: Tue Apr 19 12:55:58 2016 +0100 Committer: Sergey Beryozkin 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 authorizationLines = headers.get("Authorization"); - return authorizationLines.get(0); - } else { - return null; - } + List authorizationLines = headers.get("Authorization"); + if (authorizationLines != null && !authorizationLines.isEmpty()) { + return authorizationLines.get(0); + } + } + return null; } public static SimpleDateFormat getHttpDateFormat() {