Hi all,
So, with restlet 2.0.6, I'm annotating my resource methods like this:
@Get("xml")
public MyResult getResult()
As expected, the annotation is used to do content negotiation. However I was
surprised to discover that a client that sends in an Accept header that does
not match (for e.g. "Accept: image/jpeg") does not result in a 406 error and
instead gets served.
On inspection of ConnegUtils.getPreferredVariant it looks to me like if no
match is available then the default variant is returned. Unless I am reading
this wrong, this seems to me in direct violation of
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 :
"If an Accept header field is present, and if the server cannot send a
response which is acceptable according to the combined Accept field value,
then the server SHOULD send a 406 (not acceptable) response"
Is this a bug or is my understanding wrong?
Ishaaq
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2721659