You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2018/01/11 08:37:37 UTC

[cxf] branch 3.1.x-fixes updated: [CXF-7607]JAXRS only consider the first Accept header in the request

This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
     new aecbd09  [CXF-7607]JAXRS only consider the first Accept header in the request
aecbd09 is described below

commit aecbd091242706b35223f1ac63e569a96e9f2294
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Thu Jan 11 11:08:57 2018 +0800

    [CXF-7607]JAXRS only consider the first Accept header in the request
    
    (cherry picked from commit 116cb7d2df3537b4500b8da7bd261d778dd4c57e)
    
    Conflicts:
    	systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
---
 .../http/src/main/java/org/apache/cxf/transport/http/Headers.java   | 6 ++++++
 1 file changed, 6 insertions(+)

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 c66b4b9..6ca427a 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
@@ -451,6 +451,12 @@ public class Headers {
             }
             for (Enumeration<String> e2 = req.getHeaders(fname); e2.hasMoreElements();) {
                 String val = e2.nextElement();
+                if ("Accept".equals(mappedName) && values.size() > 0) {
+                    //ensure we collapse Accept into first line
+                    String firstAccept = values.get(0);
+                    firstAccept = firstAccept + ", " + val;
+                    values.set(0, firstAccept);
+                }
                 values.add(val);
             }
         }

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].