cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Guignard <rom1.guign...@gmail.com>
Subject Re: CXF JAXRS and Single Header value
Date Mon, 02 Mar 2015 17:10:14 GMT
Exactly, we have discuseed it on CXF IRC. I continue to debug this point
and I have realized others tests.


This is the response header captured with chrome debugger:


Connection:Keep-Alive

Content-Disposition: [attachment; filename="test.png"]

Content-Length:2710

Content-Type:application/png

Date:Mon, 02 Mar 2015 17:02:40 GMT

ETag:"75358335dff9f387ss9422dbcde70c11"

Keep-Alive:timeout=5, max=100

Last-Modified:Thu, 27 Feb 2015 14:01:08 GMT

X-Owner:[0d1ad896-7938-11e4-a487-000c29484743]



As you can see, only additional headers (Content-Disposition and X-Object)
are between brackets.

Consequently, Chrome cannot interpret the Content-Disposition header. To
validate this, I placed a reverse proxy that rewrites the
Content-Disposition header response without bracket. And in this case,
chrome correctly interpreted the header




On 2 March 2015 at 16:25, Sergey Beryozkin <sberyozkin@gmail.com> wrote:

> Hi
>
> I have discussed it on CXF IRC recently (possibly with yourself), I do not
> think CXF JAX-RS wraps single header values in square brackets, as I said
> on IRC it must be a debugging output,
>
> Any HTTP header is typically represented as a key to list of values pair,
> and hence you see though brackets.
>
> Run it all through a TCP trace utility to confirm no brackets is on the
> wire
>
> Cheers, Sergey
> On 02/03/15 15:01, Romain Guignard wrote:
>
>> Hi guys
>>
>> I have a question about REST header management and the possibility to add
>> a
>> single header value.
>>
>> When I put customs header on a REST response:
>>
>> *response.header("Object-Meta-Owner ",
>> "0d1ad896-7938-11e4-a487-000c29484743"))*, it appears that the header
>> value
>> is contains between brackets like this
>>
>> *X-Object-Meta-Owner: [0d1ad896-7938-11e4-a487-000c29484743]*
>>
>>
>> Is there a way to put a single value header and consequently to return a
>> response header without these brackets?
>>
>>
>> I have the same problem by setting a “content-disposition” header that
>> must
>> be directly interpreted by browsers. But, because the value is between
>> brackets some browsers cannot interpreted the header (it’s the case of
>> Chrome for example)
>>
>>
>> For information, I use CXF-RT-* version 3.0.1
>>
>>
>> Thanks in advance
>>
>>
>> Romain
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message