jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Possible issues with section 3.8 and sentences 9/10

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Tue, 23 Apr 2013 12:39:58 +0100

The spec says application/octet-stream should be used of no Content-Type
is set. Thus IMHO it makes sense to consider clarifying the text a bit,
in other words

POST /text

sometext

will result in the runtime still seeing "sometext" except that
Content-Type will application/octet-stream, hence it makes sense that
the client still sees the response like "sometextresponse" even if the
resulting response type is "text/*", I doubt any real world applications
would do 406 in such cases...

By the way, I hope I'm not breaking some consensus that given 2.0 is
nearly out we should not discuss anything till the next process begins :-)

Sergey

On 22/04/13 17:49, Sergey Beryozkin wrote:
> Hi
>
> Section 3.8 concludes with
>
> 9. If M contains ‘*/*’ or ‘application/*’, set Mselected =
> ‘application/octet-stream’, finish.
> 10. Generate a NotAcceptableException (406 status) and no entity.
>
> I'm seeing an early test failing where we have
>
> Accept: text/*
> Produces: text/*
>
> CXF produces: 200 + application/octet-stream, test expects 406.
> It is not a big problem for us to make sure that if a wildcard response
> types does not meet requirements from 9, them it is 406 (as per 10.),
> however, I wonder, should we always do 9. whenever a response type
> contains "*", not only if it is a wildcard or application/* ?
>
> It is kind of strange to get 406 returned when a match has been successful.
>
> I can open a minor improvement request for 2.1 if you agree
>
> Sergey
>
>