cxf-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1153363&view=rev
Log:
Merged revisions 1153362 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes

................
  r1153362 | sergeyb | 2011-08-03 08:01:38 +0100 (Wed, 03 Aug 2011) | 9 lines
  
  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.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Aug  3 07:04:59 2011
@@ -0,0 +1,2 @@
+/cxf/branches/2.4.x-fixes:1153362
+/cxf/trunk:1153258

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

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=1153363&r1=1153362&r2=1153363&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
Wed Aug  3 07:04:59 2011
@@ -618,12 +618,10 @@ public class WebClient extends AbstractC
     protected Response doInvoke(String httpMethod, Object body, Class<?> responseClass,
Type genericType) {
         
         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