title: CloudFront is not correctly passing back the Access-Control-Allow-Origin header from S3
body: <p>I am accessing CloudFront from two different domains.  I configured S3 to allow cross-origin from both domains.  A page from mydomain1 would get the data properly, then a page from mydomain2 would send out the request correctly:</p>
  <pre><code>&gt; origin: https://mydomain2
  </code></pre>
  <p>and CloudFront responded with:</p>
  <pre><code>&lt; content-type: application/json
  &lt; content-length: 65
  &lt; date: Fri, 04 Dec 2020 22:45:50 GMT
  &lt; access-control-allow-origin: https://mydomain1
  &lt; access-control-allow-methods: GET, PUT
  &lt; access-control-allow-credentials: true
  &lt; accept-ranges: bytes
  &lt; server: AmazonS3
  &lt; x-cache: Hit from cloudfront
  </code></pre>
  <p>Of course, the browser blocked this request, as the allowed-origin didn’t match</p>
  <p>I initially thought that I had the Origin Request Policy wrong, but no, I was using the Managed-CORS-S3Origin, which had the right <em>name</em> and I checked it and it said it was passing along the Origin header to S3 origin — the problem was not made any easier by the fact that “origin” in the Content Distribution business means something very different than what it means in HTTP business.</p>
  <p>But clearly, the value of the Access-Control-Allow-Origin response header <em>is</em> being cached for some reason.</p>