title: Chrome blocks file with correct CORS header
body: <p>I am using express to make an app which you could POST to and it would send to a private discord channel. However, when I tried to POST to it in a web app in Chrome, it says that no Access Allow Control Origin header is present on the file.</p>
  <pre><code>Access to XMLHttpRequest at 'https://lightcraftsapithing.herokuapp.com/api/discord/contact' from origin
  'https://lightcraftmc.com' 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.
  </code></pre>
  <p>However, when I try to do the exact same thing on Postman, the response does have the header.</p>
  <pre><code>Access-Control-Allow-Origin: *
  </code></pre>
  <p>This is my script for the website:</p>
  <pre class="lang-js prettyprint-override"><code>        $.ajax({
              method: &quot;POST&quot;,
              url:'https://lightcraftsapithing.herokuapp.com/api/discord/contact', 
              data:{
                  &quot;name&quot;: document.getElementById('name').value,
                  &quot;email&quot;: document.getElementById('email').value,
                  &quot;subject&quot;: document.getElementById('subject').value,
                  &quot;message&quot;: document.getElementById('name').value
                  },
              headers: {
                  &quot;Content-Type&quot;: &quot;application/json&quot;
              }})
      }
  </code></pre>
  <p>I feel like something is wrong with the jquery script. How can I solve it?</p>
  <p>Edit: server side script:</p>
  <pre><code>res.setHeader(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)
  res.status(200).send(data)
  </code></pre>