Add constants for application/cbor to MediaType

Closes gh-23042
This commit is contained in:
Johnny Lim
2019-05-28 11:29:44 +09:00
committed by Brian Clozel
parent 53597f90e9
commit 83078eb6fd
6 changed files with 19 additions and 6 deletions

View File

@@ -450,7 +450,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
defaultMediaTypes.put("smile", "application/x-jackson-smile");
}
if (jackson2CborPresent) {
defaultMediaTypes.put("cbor", "application/cbor");
defaultMediaTypes.put("cbor", MediaType.APPLICATION_CBOR_VALUE);
}
return defaultMediaTypes;
}

View File

@@ -427,7 +427,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
map.put("smile", MediaType.valueOf("application/x-jackson-smile"));
}
if (jackson2CborPresent) {
map.put("cbor", MediaType.valueOf("application/cbor"));
map.put("cbor", MediaType.APPLICATION_CBOR);
}
return map;
}