cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1153362 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
Date Wed, 03 Aug 2011 07:01:38 GMT
Author: sergeyb
Date: Wed Aug  3 07:01:38 2011
New Revision: 1153362

URL: http://svn.apache.org/viewvc?rev=1153362&view=rev
Log:
Merged revisions 1153258 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1153258 | sergeyb | 2011-08-02 20:56:35 +0100 (Tue, 02 Aug 2011) | 1 line
  
  [CXF-3703] Minor update to WebClient to avoid overriding Content-Type for GET requests
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug  3 07:01:38 2011
@@ -1 +1 @@
-/cxf/trunk:1153249
+/cxf/trunk:1153249,1153258

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=1153362&r1=1153361&r2=1153362&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
Wed Aug  3 07:01:38 2011
@@ -650,12 +650,10 @@ public class WebClient extends AbstractC
                                 Class<?> responseClass, Type outGenericType) {
         
         MultivaluedMap<String, String> headers = getHeaders();
-        if (body != null) {
-            if (headers.getFirst(HttpHeaders.CONTENT_TYPE) == null) {
-                headers.putSingle(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML_TYPE.toString());
-            }
-        } else {
-            headers.putSingle(HttpHeaders.CONTENT_TYPE, MediaType.WILDCARD);
+        boolean contentTypeNotSet = headers.getFirst(HttpHeaders.CONTENT_TYPE) == null;
+        if (contentTypeNotSet) {
+            String ct = body != null ? MediaType.APPLICATION_XML_TYPE.toString() : "*/*";
+            headers.putSingle(HttpHeaders.CONTENT_TYPE, ct);
         }
         if (responseClass != null && headers.getFirst(HttpHeaders.ACCEPT) == null)
{
             headers.putSingle(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML_TYPE.toString());



Mime
View raw message