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:13:15 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes aa57ecfb9 -> f8ee91929


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

Branch: refs/heads/3.1.x-fixes
Commit: f8ee9192936110ae2daa419a52ac3818f46e00ca
Parents: aa57ecf
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:11:37 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/f8ee9192/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 3990af4..79c4d4a 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/f8ee9192/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 e685d30..6b70283 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