You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Klevenz, Stephan" <st...@sap.com> on 2013/05/31 12:14:15 UTC

Regression in Content Type handling?

Hi,

I did upgrade from CXF 2.7.0 to 2.7.5 recently and recognized some changes in content type handling in the REST part of CXF.

There is one strange behavior with response handling in relation to content type. I am having a resource with a method annotated by @Path and @GET and which returns a JAX-RS response *). In the response object I do set various headers where one is the content type:


{DataServiceVersion=[2.0], Content-Type=[cvs], ETag=[W/"3"]}


On the http client the content type is not set in the response.


Is this a known issue?


Regards,

Stephan


*) Actually the resource is a root locator annotated with @PATH and a sub locator annotated with a @GET method.

Re: Regression in Content Type handling?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Stephan

Yes, I did quite a few changes (it was not really possible to update the
content type from filters), but I haven't heard of the regressions so far.
Where do you set "cvs" type from ? Is the actual value "cvs" ?

Cheers, Sergey


On Fri, May 31, 2013 at 11:14 AM, Klevenz, Stephan
<st...@sap.com>wrote:

> Hi,
>
> I did upgrade from CXF 2.7.0 to 2.7.5 recently and recognized some changes
> in content type handling in the REST part of CXF.
>
> There is one strange behavior with response handling in relation to
> content type. I am having a resource with a method annotated by @Path and
> @GET and which returns a JAX-RS response *). In the response object I do
> set various headers where one is the content type:
>
>
> {DataServiceVersion=[2.0], Content-Type=[cvs], ETag=[W/"3"]}
>
>
> On the http client the content type is not set in the response.
>
>
> Is this a known issue?
>
>
> Regards,
>
> Stephan
>
>
> *) Actually the resource is a root locator annotated with @PATH and a sub
> locator annotated with a @GET method.
>



-- 
Sergey Beryozkin

http://sberyozkin.blogspot.com
Talend - http://www.talend.com

Re: Regression in Content Type handling?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 06/06/13 13:58, Klevenz, Stephan wrote:
> Hi,
>
> This is not an issue anymore. However the behavior of implementation has changed:
>
> Response.header("Content-Type", "*/*").entity(null).build();
>
> Previously a call like this did return the content type in the response. Now it doesn't because of content == null. This is a correct behavior. We have to adapt some test cases which made use of the tolerant behavior of the previous CXF version.
>
Thanks for the update, indeed, I got tired of seeing Content-Type being 
reported with the empty payloads :-) (it may even have been enforced by 
TCK, don't recall right now), so I updated the code. Note there might be 
few more related changes (on the trunk for now) to do with handling 
various Content-Type related edge cases, as enforced by TCK tests, that 
might affect few tests once you upgrade

Thanks, Sergey

> Regards,
> Stephan
>
>
>
>
>
>
>
> From: <Klevenz>, SAP SAP <st...@sap.com>>
> Date: Freitag, 31. Mai 2013 12:14
> To: "users@cxf.apache.org<ma...@cxf.apache.org>" <us...@cxf.apache.org>>
> Subject: Regression in Content Type handling?
>
> Hi,
>
> I did upgrade from CXF 2.7.0 to 2.7.5 recently and recognized some changes in content type handling in the REST part of CXF.
>
> There is one strange behavior with response handling in relation to content type. I am having a resource with a method annotated by @Path and @GET and which returns a JAX-RS response *). In the response object I do set various headers where one is the content type:
>
>
> {DataServiceVersion=[2.0], Content-Type=[cvs], ETag=[W/"3"]}
>
>
> On the http client the content type is not set in the response.
>
>
> Is this a known issue?
>
>
> Regards,
>
> Stephan
>
>
> *) Actually the resource is a root locator annotated with @PATH and a sub locator annotated with a @GET method.
>



Re: Regression in Content Type handling?

Posted by "Klevenz, Stephan" <st...@sap.com>.
Hi,

This is not an issue anymore. However the behavior of implementation has changed:

Response.header("Content-Type", "*/*").entity(null).build();

Previously a call like this did return the content type in the response. Now it doesn't because of content == null. This is a correct behavior. We have to adapt some test cases which made use of the tolerant behavior of the previous CXF version.

Regards,
Stephan







From: <Klevenz>, SAP SAP <st...@sap.com>>
Date: Freitag, 31. Mai 2013 12:14
To: "users@cxf.apache.org<ma...@cxf.apache.org>" <us...@cxf.apache.org>>
Subject: Regression in Content Type handling?

Hi,

I did upgrade from CXF 2.7.0 to 2.7.5 recently and recognized some changes in content type handling in the REST part of CXF.

There is one strange behavior with response handling in relation to content type. I am having a resource with a method annotated by @Path and @GET and which returns a JAX-RS response *). In the response object I do set various headers where one is the content type:


{DataServiceVersion=[2.0], Content-Type=[cvs], ETag=[W/"3"]}


On the http client the content type is not set in the response.


Is this a known issue?


Regards,

Stephan


*) Actually the resource is a root locator annotated with @PATH and a sub locator annotated with a @GET method.