2121import org .springframework .context .annotation .Bean ;
2222import org .springframework .context .annotation .ComponentScan ;
2323import org .springframework .context .annotation .Configuration ;
24+ import org .springframework .http .MediaType ;
2425import org .springframework .security .core .session .SessionRegistry ;
2526import org .springframework .security .core .session .SessionRegistryImpl ;
2627import org .springframework .security .web .session .HttpSessionEventPublisher ;
2728
2829import java .net .MalformedURLException ;
2930import java .net .URL ;
3031import java .time .Duration ;
32+ import java .util .ArrayList ;
33+ import java .util .List ;
3134import java .util .Map ;
3235
3336@ Configuration
@@ -45,6 +48,25 @@ public class AppConfig {
4548 public FastJsonHttpMessageConverter fastJsonHttpMessageConverter () {
4649 FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter ();
4750
51+ List <MediaType > supportedMediaTypes = new ArrayList <>();
52+ supportedMediaTypes .add (MediaType .APPLICATION_JSON );
53+ supportedMediaTypes .add (MediaType .APPLICATION_ATOM_XML );
54+ supportedMediaTypes .add (MediaType .APPLICATION_FORM_URLENCODED );
55+ supportedMediaTypes .add (MediaType .APPLICATION_OCTET_STREAM );
56+ supportedMediaTypes .add (MediaType .APPLICATION_PDF );
57+ supportedMediaTypes .add (MediaType .APPLICATION_RSS_XML );
58+ supportedMediaTypes .add (MediaType .APPLICATION_XHTML_XML );
59+ supportedMediaTypes .add (MediaType .APPLICATION_XML );
60+ supportedMediaTypes .add (MediaType .IMAGE_GIF );
61+ supportedMediaTypes .add (MediaType .IMAGE_JPEG );
62+ supportedMediaTypes .add (MediaType .IMAGE_PNG );
63+ supportedMediaTypes .add (MediaType .TEXT_EVENT_STREAM );
64+ supportedMediaTypes .add (MediaType .TEXT_HTML );
65+ supportedMediaTypes .add (MediaType .TEXT_MARKDOWN );
66+ supportedMediaTypes .add (MediaType .TEXT_PLAIN );
67+ supportedMediaTypes .add (MediaType .TEXT_XML );
68+ fastConverter .setSupportedMediaTypes (supportedMediaTypes );
69+
4870 FastJsonConfig fastJsonConfig = new FastJsonConfig ();
4971 fastJsonConfig .setSerializerFeatures (
5072 SerializerFeature .WriteMapNullValue ,
0 commit comments