Hi
On 05/02/15 16:21, Bruno Cappoen wrote:
Hi, you're right. The content-type is now */*. It's problematic for us. The
only solution that we find is to use Httpclient directly to remove field
content-type.

I think we can update the CXF code to ensure this defaulting to */* is avoided for CXF AsyncHttpConduit that uses HttpClient. It is just HttpUrlConnection has some strange side-effects if Content-Type is missing (for empty POST it decides to put a form media type, and if it is an http-proxy based call then GET without Content-Type results in a browser-like Accept replacing Accept provided by the client code - very strange).

I'll try to do a relevant update before 3.0.4 gets out.
Sergey

2015-02-03 18:16 GMT+01:00 Sergey Beryozkin <[email protected]>:

Hi,
I think this should've been mostly fixed with 3.0.4.
But you'd still likely see a wilcard Content-Type in such cases - this is
due to Java HttpUrlConnection doing some unexpected defaults if it sees no
Content-Type set

Can you check 3.0.4-SNAPSHOT please ?

Sergey
On 03/02/15 17:08, Bruno Cappoen wrote:

Hi,

I reproduce the behaviour with a simple projet.

My only dependency:

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.0.3</version>
</dependency>


The Main class:

import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.WebClient;

public class Test
{

      public static void main(String[] args) {
          WebClient.create("http://www.google.fr";).get();
      }

}

If I inspect the emitted request, I see:


GET / HTTP/1.1
*Content-Type: text/xml*
Accept: */*
User-Agent: Apache CXF 3.0.3
Cache-Control: no-cache
Pragma: no-cache
Host: www.google.fr
Connection: keep-alive

Does someone know why CXF is sending the Content-Type header even for a
GET
request without any body?

Thanks,

Brubru





Reply via email to