title: how to add content-length to response headers when i use spring cloud to build my micro service
body: <p>I have used spring cloud to build a multiple microservice,and i use a API-Gateway implemented using Spring Cloud Netfix's Zuul Server to route the requests to our micro services ,the gateway config like this:</p>
  
  <p>application.yml:</p>
  
  <pre><code>server:
  port: 8021
  
  ribbon:
  ConnectTimeout: 3000
  ReadTimeout: 60000
  
  zuul:
  ignoredServices: "*"
  add-proxy-headers: true
  #prefix: /v1
  
  routes:
  m_test:
  path: /api/testService/**
  sensitiveHeaders: "*"
  url: http://127.0.0.1:4008/testService/  
  
  eureka:
  instance:
  hostname: gateway
  client:
   registerWithEureka: true
   fetchRegistry: true
  serviceUrl:
    defaultZone: http://127.0.0.1:8761/eureka/
  </code></pre>
  
  <p>CorsFilter.java:</p>
  
  <pre><code>@Component
  @Order(Ordered.HIGHEST_PRECEDENCE)
  public class CorsFilter implements Filter {
  public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
  
      HttpServletResponse response = (HttpServletResponse) res;
      HttpServletRequest request = (HttpServletRequest) req;
      response.setHeader("Access-Control-Allow-Origin", "*");
      response.setHeader("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS, DELETE");
      response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization,Content-length");
      response.setHeader("Access-Control-Max-Age", "1800");
      Map&lt;String, String&gt; map = getHeadersInfo(request);
  
      if (request.getMethod().equalsIgnoreCase("OPTIONS")) {
          response.setStatus(HttpServletResponse.SC_OK);
      } else {
          chain.doFilter(request, response);
      }
  }
  
  public void init(FilterConfig filterConfig) {
  }
  
  public void destroy() {
  }
  
  private Map&lt;String, String&gt; getHeadersInfo(HttpServletRequest request) {
      Map&lt;String, String&gt; map = new HashMap&lt;&gt;();
      Enumeration headerNames = request.getHeaderNames();
      while (headerNames.hasMoreElements()) {
          String key = (String) headerNames.nextElement();
          String value = request.getHeader(key);
          map.put(key, value);
      }
  
      return map;
  }
  }
  </code></pre>
  
  <p>GatewaySystemApplication.java:</p>
  
  <pre><code>@SpringBootApplication
  @EnableZuulProxy
  @EnableEurekaClient
  public class GatewaySystemApplication {
  
  public static void main(String[] args) throws Exception {
      //SpringApplication.run(GatewaySystemApplication.class, args);
      new SpringApplicationBuilder(GatewaySystemApplication.class).web(true).run(args);
  }
  }
  </code></pre>
  
  <p>The browser response headers are like this:</p>
  
  <p><a href="https://i.stack.imgur.com/jeFDo.png" rel="nofollow noreferrer">passing through gateway layer response headers</a></p>
  
  <p>and the response header of my request miss the content-length,
  but it has the content-length when i directly invoke backend service.<a href="https://i.stack.imgur.com/2IYfM.png" rel="nofollow noreferrer">directly response headers</a></p>