title: Angular cors issue :Response to preflight request doesn't pass access control check: It does not have HTTP ok status
body: <p>I have an angular 8 application which makes a POST request to Flask REST API's which are hosted on IIS server(with windows Authntication). The problem is every time I do a POST request from my angular code I get CORS error:</p>
  <p><code>Response to preflight request doesn't pass access control check: It does not have HTTP ok status.</code></p>
  <p>The api's work fine when I call them directly from browser directly the problem is when I call them from my angular project.</p>
  <p>I have used the flask-CORS library:</p>
  <pre><code>cors = CORS(app, resources={r&quot;/*&quot;: {&quot;origins&quot;: &quot;*&quot;}})
  
  @app.route('/', methods=['GET', 'POST'])
  @cross_origin(origin='*', headers=['Content-Type', 'Authorization'], supports_credentials=True)
  def home(): 
      &quot;&quot;&quot;
      Returns template for Home page .
      &quot;&quot;&quot;
      return &quot;&lt;h1&gt;Home Page&lt;/h1&gt;&quot;
  </code></pre>
  <p>I In my IIS server I have set these HTTP response headers:</p>
  <pre><code>Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token
  Access-Control-Allow-Origin: *
  Access-Control-Allow-Methods: POST, GET, OPTIONS
  </code></pre>
  <p>When I check the network tab I get CORS error and not status 401 so I assume the error is not an authentication issue.</p>
  <p>I have been through multiple stackoverflow questions but all of them deal with ASP.net and the few that deal with flask they all mentioned setting the Headers in IIS server but my issue remains unsolved.</p>
  <p>Please guide me on this...</p>
  <p>EDIT</p>
  <p>This are my response headers:</p>
  <pre><code>Provisional headers are shown
  Accept: application/json, text/plain, */*
  content-type: application/json
  </code></pre>