From: Przemyslaw W. <prz...@go...> - 2015-05-14 11:04:57
|
On 14.05.2015 03:38, Ron Sigal wrote: > Very interesting. Honestly, I'm not sure how to think about this. The > JAX-RS 1.1 spec says "An implementation MUST NOT invoke a method whose > effective value of @Produces does not match the request Accept header.", > but I don't see where it ever actually defines "match". And Resteasy > passes the TCK tests. Really, I'm not even sure what "match" SHOULD > mean. We could get crazy and do full blown unification > (http://en.wikipedia.org/wiki/Unification_%28computer_science%29). Ugh. > > Resource matching is a very fundamental notion in JAX-RS, and I wouldn't > want to make any changes without being very careful. > > Any thoughts about how to interpret "match"? Certainly the decisive answer would be: in the same way as HTTP spec does. But unfortunately, I can't find relevant spec part that explicitly says that content type of 'type/subtype;key=value' matches Accept header of 'type/subtype'. The examples in [1] suggests so, as does the practice of browser 'Accept' header. So, in my opinion, the @Produces("text/plain;charset=utf-8") should be considered as matching the relevant client's request.accept("text/plain"); Przemek |