##### Coverage Report - com.ctrip.apollo.common.controller.CharacterEncodingFilterConfiguration

Classes in this File | Line Coverage | Branch Coverage | Complexity
CharacterEncodingFilterConfiguration |
0% | 0/8
N/A | N/A
| 1.0;1

1 |  |
     package com.ctrip.apollo.common.controller;
2 |  |
3 |  |
     import javax.servlet.DispatcherType;
4 |  |
5 |  |
     import org.springframework.boot.context.embedded.FilterRegistrationBean;
6 |  |
     import org.springframework.context.annotation.Bean;
7 |  |
     import org.springframework.context.annotation.Configuration;
8 |  |
     import org.springframework.web.filter.CharacterEncodingFilter;
9 |  |
10 |  |
     @Configuration
11 | 0 |
     public class CharacterEncodingFilterConfiguration {
12 |  |
13 |  |
       @Bean
14 |  |
       public FilterRegistrationBean encodingFilter() {
15 | 0 |
         FilterRegistrationBean bean = new FilterRegistrationBean();
16 | 0 |
         bean.setFilter(new CharacterEncodingFilter());
17 | 0 |
         bean.addInitParameter("encoding", "UTF-8");
18 |  |
         //FIXME: https://github.com/Netflix/eureka/issues/702
19 |  |
     //    bean.addInitParameter("forceEncoding", "true");
20 | 0 |
         bean.setName("encodingFilter");
21 | 0 |
         bean.addUrlPatterns("/*");
22 | 0 |
         bean.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.FORWARD);
23 | 0 |
         return bean;
24 |  |
       }
25 |  |
     }