title: Access-Control-Allow-Origin option not working - CORS Issue
body: <p>I have a react app, in which I am trying to make an API call using fetch() method.</p>
  <p><code>fetch(&quot;https://example.com/user&quot;);</code> something like this. but it is throwing an error like below.</p>
  <blockquote>
  <p>from origin 'http://localhost:3000' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'http://localhost:3000' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.</p>
  </blockquote>
  <p>my project is running on <code>localhost:3000</code> and calling API like <code>https://example.com/user</code>.</p>
  <p>I kept <code>Access-Control-Allow-Origin: *</code></p>
  <pre class="lang-js prettyprint-override"><code>fetch(&quot;https://example.com/user&quot;, {
    headers: {
      &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;
    })
  </code></pre>
  <p>but got below error.</p>
  <blockquote>
  <p>Access to fetch at 'https://example.com/user` from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.</p>
  </blockquote>
  <p>tried <code>mode:no-cors</code></p>
  <pre class="lang-js prettyprint-override"><code>fetch(&quot;https://example.com/user&quot;, {
    headers: {
       &quot;mode&quot;:&quot;no-cors&quot;
    })
  </code></pre>
  <p>but got same error i.e.</p>
  <blockquote>
  <p>Access to fetch at 'https://example.com/user` from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.</p>
  </blockquote>
  <p>for both options</p>
  <pre class="lang-js prettyprint-override"><code>fetch(&quot;https://example.com/user&quot;, {
    headers: {
       &quot;Access-Control-Allow-Origin&quot;: &quot;*&quot;
       &quot;mode&quot;:&quot;no-cors&quot;
    })
  </code></pre>
  <p>got the below error.</p>
  <blockquote>
  <p>Access to fetch at 'https://example.com/user`' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.</p>
  </blockquote>