users@jersey.java.net

[Jersey] Jersey 2.x accepts requests with unspecified content type and empty body.

From: <TheCuriousOne_at_centrum.cz>
Date: Fri, 20 Sep 2013 17:01:08 +0200

Hi, this might be a bug (or I might be doing something wrong), but Jersey accepts requests where the content type is not specified (even though the resource is annotated with @Consumes(MediaType.APPLICATION_JSON)) and whose body is empty (even though the resource expects non-empty JSON body). Here is a minimal example (replace "_" with "/" in the file names, compile using "mvn clean install exec:java"): https://gist.github.com/anonymous/8c0426646c334cecda50

Cheers,
P.