Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
ff8fa037
Commit
ff8fa037
authored
Mar 07, 2017
by
张乐
Committed by
GitHub
Mar 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #558 from nobodyiam/fix-index-encoding
add html mime type as utf-8
parents
20b5b8e6
141edca6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
WebMvcConfig.java
...trip/framework/apollo/common/controller/WebMvcConfig.java
+10
-1
No files found.
apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java
View file @
ff8fa037
package
com
.
ctrip
.
framework
.
apollo
.
common
.
controller
;
import
org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
;
import
org.springframework.boot.context.embedded.MimeMappings
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.web.PageableHandlerMethodArgumentResolver
;
...
...
@@ -11,7 +14,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import
java.util.List
;
@Configuration
public
class
WebMvcConfig
extends
WebMvcConfigurerAdapter
{
public
class
WebMvcConfig
extends
WebMvcConfigurerAdapter
implements
EmbeddedServletContainerCustomizer
{
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
...
...
@@ -28,4 +31,10 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
configurer
.
ignoreAcceptHeader
(
true
).
defaultContentType
(
MediaType
.
APPLICATION_JSON
);
}
@Override
public
void
customize
(
ConfigurableEmbeddedServletContainer
container
)
{
MimeMappings
mappings
=
new
MimeMappings
(
MimeMappings
.
DEFAULT
);
mappings
.
add
(
"html"
,
"text/html;charset=utf-8"
);
container
.
setMimeMappings
(
mappings
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment