title: The 'Access-Control-Allow-Origin' header has a value 'http://localhost:4200' that is not equal to the supplied origin
body: <p>(continuation of error message in title) " Origin '<a href="http://127.0.0.1:4200" rel="noreferrer">http://127.0.0.1:4200</a>' is therefore not allowed access."</p>
  
  <p>I am unable to run the same Angular 5 site on two different domains when working with the same API.</p>
  
  <p>This error message is coming from Chrome.  The error in Firefox is:</p>
  
  <p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="http://myapitest.local/v1/subscription/current/products" rel="noreferrer">http://myapitest.local/v1/subscription/current/products</a>. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘<a href="http://127.0.0.1:4200" rel="noreferrer">http://127.0.0.1:4200</a>’)</p>
  
  <p>I noticed this when working on a white-labeled version of our Angular app that will be running on an alternative URL from our regular app, but still using the same Laravel api running on the same URL.  I've added the appropriate CORS configuration to Laravel, this appears to be a browser issue - not sure how to get around it.</p>
  
  <p>I have recreated this at localhost by changing from localhost:4200 to 127.0.0.1:4200 for instance.</p>
  
  <p>Oddly, the preflight seems to be successful with correct CORS headers.
  <a href="https://i.stack.imgur.com/ktQPS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ktQPS.png" alt="enter image description here"></a></p>
  
  <p>However, on the GET, it seems to come back with the WRONG Access-Control-Allow-Origin header on the response.<br>
  <a href="https://i.stack.imgur.com/xclEJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xclEJ.png" alt="enter image description here"></a></p>
  
  <p>Worth noting here that changing my Allowed Origins in the API to allow all ('*') does not fix this issue.</p>
  
  <p>I'm not sure what other information or code I could provide to make this clearer.  Thanks.</p>