title: Cloudflare workers CORS ignored
body: <p>I created a SendGrid form using CF Workers and set (for testing) Access-Control-Allow-Origin&quot;, '*' but it's being ignored on the frontend:</p>
  <pre><code>Access to XMLHttpRequest at 'https://&lt;domain&gt;.workers.dev/' from origin 'https://&lt;frontend-domain&gt;.dev' 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>Do I need to also add it to the AXIOS <code>POST</code> request?</p>
  <p>Here's code from my workers file:</p>
  <pre><code>const myHeaders = new Headers();
    myHeaders.set(&quot;Access-Control-Allow-Origin&quot;, '*');
    myHeaders.set(&quot;Access-Control-Allow-Methods&quot;, &quot;GET,HEAD,POST,OPTIONS&quot;);
    myHeaders.set(&quot;Access-Control-Max-Age&quot;, &quot;86400&quot;,);
    return new Response((emailResponse.ok), {status: 200, headers: myHeaders}) 
  </code></pre>
  <p>And here's the AXIOS request:</p>
  <pre><code>this.$axios.$post(
    &quot;https://&lt;domain&gt;.workers.dev/&quot;,
    {
      name: this.mailData.name,
      eMail: this.mailData.eMail,
      phone: this.mailData.phone,
      message: this.mailData.message,
    },
    {
      headers: {
        &quot;Content-Type&quot;: &quot;application/json&quot;,
      },
    }
  );
  
  </code></pre>
  <p>It all works fine using Insomnia and the headers are visible there:
  <a href="https://i.stack.imgur.com/M9mXI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M9mXI.jpg" alt="enter image description here" /></a></p>