title: Why are my requests from HTTPS domain to HTTP localhost failing CORS?
body: <p>I have a rest service (implemented as an Azure Function), running on HTTPS, on domain A.</p>
  
  <p>I have a web site, running on HTTPS on domain B.</p>
  
  <p>I have specified wildcard * for cors.</p>
  
  <p>Using jQuery on the web site I send Ajax requests to the rest service. This works, I can see my <code>GET</code> request preflighted by an <code>OPTIONS</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/kYv8B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kYv8B.png" alt="enter image description here"></a></p>
  
  <p>When I am developing my rest service I would like to host the service locally, running on HTTP, on the localhost domain. This doesnt seem to work.</p>
  
  <p>I have to enable mixed content, but then it doesnt seem like the browser (Firefox) sends or preflights my request - the network traffic is empty. It looks like my request is failing the CORS request.</p>
  
  <p>This appears in the Firefox console.</p>
  
  <pre><code>16:42:56.550 Loading mixed (insecure) active content "http://locahost:7071/api/test/get?message=get+hello+world!" on a secure page[Learn More] ajax.ts:153:23
  16:42:56.558 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://locahost:7071/api/test/get?message=get+hello+world!. (Reason: CORS request did not succeed).
  </code></pre>
  
  <p>I am able to avoid the mixed content errors by setting my local url as <code>//locahost</code>, however this still fails CORS.</p>
  
  <p>Does this happen because I am trying to do CORS from HTTPS domain to HTTP localhost?</p>