title: RestTemplate not passing Origin header
body: <p>I'm trying to make a cross-origin request using Spring's RestTemplate. The communication is done between two Spring-boot webapps, both running on localhost but different port. What I do is:</p>
  
  <pre class="lang-java prettyprint-override"><code>HttpHeaders httpHeaders = new HttpHeaders();
  httpHeaders.setOrigin("http://localhost:8083");
  httpHeaders.add("Authorization", token);
  
  HttpEntity&lt;Void&gt; httpEntity = new HttpEntity&lt;&gt;(httpHeaders);
  
  ParameterizedTypeReference&lt;List&lt;MyObj&gt;&gt; beanType = new ParameterizedTypeReference&lt;List&lt;MyObj&gt;&gt;() {};
  ResponseEntity&lt;List&lt;MyObj&gt;&gt; list = restTemplate.exchange(serviceURL, HttpMethod.GET, httpEntity, beanType);
  </code></pre>
  
  <p>The call is executed, the "Authorization" header is passed just fine, but no matter what I try, there is no "Origin" header on the receiving side.
  When I create a simillar request using some other tool (SoapUI, RestClient Chrome plugin, etc.) the header is passed just as I provide it.</p>
  
  <p>To print all headers on the receiving side I'm using a implementation of javax.servlet.Filter with:</p>
  
  <pre class="lang-java prettyprint-override"><code>public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
          throws IOException, ServletException {
      HttpServletRequest request = (HttpServletRequest) req;
      HttpServletResponse response = (HttpServletResponse) res;
      Enumeration&lt;String&gt; headerNames = request.getHeaderNames();
      while (headerNames.hasMoreElements()) {
          String headerName = headerNames.nextElement();
          log.info(headerName + ": " + request.getHeader(headerName));
      }
  }
  </code></pre>
  
  <p>Why is the origin header not passed when using RestTemplate?</p>