title: Disable transfer-encoding in @RestController
body: <p>I am having <code>@RestController</code> with endpoint like below (spring-boot version 1.5.9.RELEASE)</p>
  
  <pre><code>@RestController
  public class Controller
  {
      @PostMapping(value = "profile", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
      @ResponseBody
      public Profile profile(@RequestBody Request request) {
          ... ... ...
          return profileObj;
      }
  }
  </code></pre>
  
  <p>Whenever I invoke above endpoint, I am getting response with below headers,</p>
  
  <pre><code>.... ... ...
  Access-Control-Allow-Headers:
  Cache-Control: no cache, no-store, must-revalidate
  Content-Type: application/json;charset=utf-8
  Transfer-Encoding: chunked
  </code></pre>
  
  <p>I want to disable transfer-encoding, i.e, I need to include content-length.</p>
  
  <p>I have many controllers like this. So I don't want to calculate length in each endpoint and return <code>ResponseEntity</code> with length value. I am looking for generic solution which will automatically include content-length. Is there anyway to achieve this?</p>