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-7236: Fix ArrayIndexOutOfBound when Accept header is not set, patch from Jeremy Kuhn applied, This closes #230
Date Mon, 30 Jan 2017 10:14:50 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 20582279c -> 39de6213d


CXF-7236: Fix ArrayIndexOutOfBound when Accept header is not set, patch from Jeremy Kuhn applied,
This closes #230


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

Branch: refs/heads/3.0.x-fixes
Commit: 39de6213defc627cc936910eb4badb01e9b3446f
Parents: 2058227
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Jan 30 10:10:04 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Jan 30 10:14:11 2017 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java   | 2 +-
 .../java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/39de6213/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
index a082fac..77dfde3 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
@@ -315,7 +315,7 @@ public class HttpHeadersImpl implements HttpHeaders {
 
     public Date getDate() {
         List<String> values = headers.get(HttpHeaders.DATE);
-        if (values == null || StringUtils.isEmpty(values.get(0))) {
+        if (values == null || values.isEmpty() || StringUtils.isEmpty(values.get(0))) {
             return null;
         }
         return HttpUtils.getHttpDate(values.get(0));

http://git-wip-us.apache.org/repos/asf/cxf/blob/39de6213/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
index 2154cd3..a561fe8 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
@@ -133,7 +133,7 @@ public class JAXRSInInterceptor extends AbstractPhaseInterceptor<Message>
{
         // Accept
         String acceptTypes = null;
         List<String> acceptHeaderValues = protocolHeaders.get(Message.ACCEPT_CONTENT_TYPE);
-        if (acceptHeaderValues != null) {
+        if (acceptHeaderValues != null && !acceptHeaderValues.isEmpty()) {
             acceptTypes = acceptHeaderValues.get(0);
             message.put(Message.ACCEPT_CONTENT_TYPE, acceptTypes);
         }


Mime
View raw message