title: Spring boot HeaderWriterFilter overrides header created in controller
body: <p>When I add a header to the responseEntity in the Controller, it is not added to the response. I debug the code, an when it reach the "HeaderWriterFilter" it adds default header, but it has no track of the one added in the Controller.</p>
  
  <pre><code>@RequestMapping(
          value = "/get-file",
          method = RequestMethod.GET
  )
  public ResponseEntity&lt;Resource&gt; download(Principal principal, Long fileId) throws IOException {
      if (principal == null) {
          throw new UsernameNotFoundException("User not found.");
      }
  
      try {
          User loggedInUser = ((LoggedInUserDetails) ((UsernamePasswordAuthenticationToken) principal).getPrincipal()).getLoggedInUser();
  
  //            Get file
          File file = this.fileService.getById(loggedInUser, fileId);
          if (file == null) {
              return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);
          }
  
  //            Get file for download
          java.io.File physicalFile = new java.io.File(file.getUrl());
          if (file == null) {
              return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
          }
          InputStreamResource resource = new InputStreamResource(new FileInputStream(physicalFile));
  
          HttpHeaders headers = new HttpHeaders();
          headers.add("test", "test.yaml");
  
          return ResponseEntity.ok()
          .headers(headers)
          .contentType(MediaType.parseMediaType("application/octet-stream"))
          .contentLength(physicalFile.length())
          .body(resource);
      }
      catch (FileNotFoundException e) {
          e.printStackTrace();
          return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);
      }
      catch (Exception e) {
          e.printStackTrace();
          return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);
      }
  }
  </code></pre>