title: ASP.Net /IIS CORS Access-Control-Allow-Origin:* not working for all requests
body: <p>I have enabled CORS by adding below to webconfig but it doesnt seems to work consistently:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;httpProtocol&gt;
        &lt;customHeaders&gt;
          &lt;add name="Access-Control-Allow-Origin" value="*" /&gt;
        &lt;/customHeaders&gt;
      &lt;/httpProtocol&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>If we add an "Origin" header in the request, it does show Access-Control-Allow-Origin:* headers in response. But if we don't add "Origin" header in the request, the server doesn't return Access-Control-Allow-Origin:* headers.</p>
  
  <p>The issue is, I am using sw-toolbox to precache static resources. But if a resource such as javascript files is already in browser cache before service worker is activated, for example the file is directly referenced in the html page and browser has already downloaded and cached the file, it shows CORS error when service worker tries to precache that file. </p>