code: private HttpHeaders createHttpHeaders(HttpMessage httpMessage,
                                            HttpEndpointConfiguration endpointConfiguration) {
  
          HttpHeaders httpHeaders = new HttpHeaders();
  
          endpointConfiguration
                  .getHeaderMapper()
                  .fromHeaders(
                          new org.springframework.messaging.MessageHeaders(httpMessage.getHeaders()),
                          httpHeaders);
  
          Map<String, Object> messageHeaders = httpMessage.getHeaders();
          for (Map.Entry<String, Object> header : messageHeaders.entrySet()) {
              if (!header.getKey().startsWith(MessageHeaders.PREFIX) &&
                      !MessageHeaderUtils.isSpringInternalHeader(header.getKey()) &&
                      !httpHeaders.containsKey(header.getKey())) {
                  httpHeaders.add(header.getKey(), header.getValue().toString());
              }
          }
  
          if (httpHeaders.getFirst(HttpMessageHeaders.HTTP_CONTENT_TYPE) == null) {
              httpHeaders.add(HttpMessageHeaders.HTTP_CONTENT_TYPE, composeContentTypeHeaderValue(endpointConfiguration));
          }
  
          return httpHeaders;
      }
docs: Creates HttpHeaders based on the outbound message and the endpoint configurations header mapper.
  @param httpMessage The HttpMessage to copy the headers from
  @param endpointConfiguration The endpoint configuration to get th header mapper from