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 1
1
package com .ctrip .framework .apollo .common .controller ;
2
2
3
+ import org .springframework .boot .context .embedded .ConfigurableEmbeddedServletContainer ;
4
+ import org .springframework .boot .context .embedded .EmbeddedServletContainerCustomizer ;
5
+ import org .springframework .boot .context .embedded .MimeMappings ;
3
6
import org .springframework .context .annotation .Configuration ;
4
7
import org .springframework .data .domain .PageRequest ;
5
8
import org .springframework .data .web .PageableHandlerMethodArgumentResolver ;
11
14
import java .util .List ;
12
15
13
16
@ Configuration
14
- public class WebMvcConfig extends WebMvcConfigurerAdapter {
17
+ public class WebMvcConfig extends WebMvcConfigurerAdapter implements EmbeddedServletContainerCustomizer {
15
18
16
19
@ Override
17
20
public void addArgumentResolvers (List <HandlerMethodArgumentResolver > argumentResolvers ) {
@@ -28,4 +31,10 @@ public void configureContentNegotiation(ContentNegotiationConfigurer configurer)
28
31
configurer .ignoreAcceptHeader (true ).defaultContentType (MediaType .APPLICATION_JSON );
29
32
}
30
33
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
+ }
31
40
}
You can’t perform that action at this time.
0 commit comments