File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
main/java/org/glassfish/jersey/logging
test/java/org/glassfish/jersey/logging Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,16 @@ abstract class LoggingInterceptor implements WriterInterceptor {
7070 private static final String NOTIFICATION_PREFIX = "* " ;
7171 private static final MediaType TEXT_MEDIA_TYPE = new MediaType ("text" , "*" );
7272
73+ /**
74+ * application/vnd.api+json (documented here: http://jsonapi.org/)
75+ * is a modified form of JSON, which is not present in the JAX-RS
76+ * MediaType class as a static constant. Requested in Issue #3849
77+ */
78+ private static final MediaType APPLICATION_VND_API_JSON = new MediaType ("application" , "vnd.api+json" );
79+
7380 private static final Set <MediaType > READABLE_APP_MEDIA_TYPES = new HashSet <MediaType >() {{
7481 add (TEXT_MEDIA_TYPE );
82+ add (APPLICATION_VND_API_JSON );
7583 add (MediaType .APPLICATION_ATOM_XML_TYPE );
7684 add (MediaType .APPLICATION_FORM_URLENCODED_TYPE );
7785 add (MediaType .APPLICATION_JSON_TYPE );
Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ public void testReadableTypeAppSubJson() {
5252 assertTrue (LoggingInterceptor .isReadable (new MediaType ("application" , "json" )));
5353 }
5454
55+ @ Test
56+ public void testReadableTypeApplicationSubVndApiJson () {
57+ assertTrue (LoggingInterceptor .isReadable (new MediaType ("application" , "vnd.api+json" )));
58+ }
59+
5560 @ Test
5661 public void testReadableTypeAppSubBinary () {
5762 assertFalse (LoggingInterceptor .isReadable (new MediaType ("application" , "octet-stream" )));
You can’t perform that action at this time.
0 commit comments