[ 
https://issues.apache.org/jira/browse/CXF-6502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Colm O hEigeartaigh closed CXF-6502.
------------------------------------

> JAXRSInInterceptor throw java.lang.IndexOutOfBoundsException if content-type 
> header is empty
> --------------------------------------------------------------------------------------------
>
>                 Key: CXF-6502
>                 URL: https://issues.apache.org/jira/browse/CXF-6502
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.2
>            Reporter: Valeriy Molyakov
>            Assignee: Sergey Beryozkin
>             Fix For: 3.0.6, 2.7.17, 3.1.2
>
>
> If client send an empty Content-Type headers CXF REST runtime throws 
> java.lang.IndexOutOfBoundsException  because list in string 122 
> (JAXRSInInterceptor.java) is emty 
>         // Content-Type
>         String requestContentType = null;
>         List<String> ctHeaderValues = 
> protocolHeaders.get(Message.CONTENT_TYPE);
>         if (ctHeaderValues != null) {
> ====>            requestContentType = ctHeaderValues.get(0);
>             message.put(Message.CONTENT_TYPE, requestContentType);
>         }
> Stack trace:
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0<br />        at 
> java.util.ArrayList.rangeCheck(ArrayList.java:635)<br />        at 
> java.util.ArrayList.get(ArrayList.java:411)<br />        at 
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:122)<br
>  />        at 
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)<br
>  />        at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)<br
>  />        at 
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)<br
>  />        at 
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243)<br
>  />        at 
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)<br
>  />        at 
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:197)<br
>  />        at 
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)<br
>  />        at 
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)<br
>  />        at 
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:290)<br
>  />        at 
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doDelete(AbstractHTTPServlet.java:220)<br
>  />        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to