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

[jsr339-experts] No Content-Type in Request - when default to application/octet-stream

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Sun, 19 Jan 2014 18:52:59 +0000

Hi

According to the spec, if no Content-Type is specified in the request
then it has to be defaulted to application/octet-stream, this is
mentioned in the section describing how MBR can be found for mapping the
stream into a given Java type.

My question is, should this 'no CT to application/octet-stream
defaulting' take place earlier, when the method selection takes place ?

I think I did try to do it earlier initially but saw CXF failing a
couple of early TCK tests as a result.

So what CXF does now is this: if no CT is available - set it to '*/*'
and do the method selection. Next, when the method selection is done,
and when MBR is checked, it is set to application/octet-stream.

I think this is wrong, but I said I believe it was TCK failures which
forced me to do it.

Can someone please confirm the above algorithm is correct or should we
actually have a 2.1 JIRA issue clarifying that when no CT is available
then set it to application/octet-stream before the resource methods are
selected ?


Thanks, Sergey