File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11package com .ctrip .framework .apollo .common .controller ;
22
3+ import org .springframework .boot .context .embedded .ConfigurableEmbeddedServletContainer ;
4+ import org .springframework .boot .context .embedded .EmbeddedServletContainerCustomizer ;
5+ import org .springframework .boot .context .embedded .MimeMappings ;
36import org .springframework .context .annotation .Configuration ;
47import org .springframework .data .domain .PageRequest ;
58import org .springframework .data .web .PageableHandlerMethodArgumentResolver ;
1114import java .util .List ;
1215
1316@ Configuration
14- public class WebMvcConfig extends WebMvcConfigurerAdapter {
17+ public class WebMvcConfig extends WebMvcConfigurerAdapter implements EmbeddedServletContainerCustomizer {
1518
1619 @ Override
1720 public void addArgumentResolvers (List <HandlerMethodArgumentResolver > argumentResolvers ) {
@@ -28,4 +31,10 @@ public void configureContentNegotiation(ContentNegotiationConfigurer configurer)
2831 configurer .ignoreAcceptHeader (true ).defaultContentType (MediaType .APPLICATION_JSON );
2932 }
3033
34+ @ Override
35+ public void customize (ConfigurableEmbeddedServletContainer container ) {
36+ MimeMappings mappings = new MimeMappings (MimeMappings .DEFAULT );
37+ mappings .add ("html" , "text/html;charset=utf-8" );
38+ container .setMimeMappings (mappings );
39+ }
3140}
You can’t perform that action at this time.
0 commit comments