title: CORS "It does not have HTTP ok status."
body: <p>NodeJS Express platform. Using Zeit Now 2. Cannot use server.js as proxy to send from backend to prevent CORS. So, nor wrestling with CORS problems. Tested desktop: chrome, safari, firefox. Mobile: chrome, firefox. Have tested to host on Now with HTTPS, same error as I get locally on both <code>localhost:3000</code> and <code>127.0.0.1:3000</code>, same using port <code>80</code>.</p>
  
  <pre><code>Access to fetch at 'https://**MY_URL**/user/login' from origin 'http://127.0.0.1:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
  </code></pre>
  
  <p>I use <a href="https://www.npmjs.com/package/cors" rel="noreferrer">https://www.npmjs.com/package/cors</a> to set my CORS configs:</p>
  
  <pre><code>app.use(cors({
    'allowedHeaders': ['Content-Type', 'API-Key', 'API-Secret', 'Access-Control-Allow-Headers'', 'accept', 'client-security-token'],
    'exposedHeaders': ['sessionId'],
    'origin': '*',
    'methods': 'GET, HEAD, PUT, PATCH, POST, DELETE, OPTIONS',
    'preflightContinue': false,
    'credentials': true
  }));
  </code></pre>
  
  <p>The CORS settings doesn't seem to work for my, so I tried with the <code>now.json</code> file, like this (trimmed veersion):</p>
  
  <pre><code>{
    "name": "my-test-api",
    "version": 2,
    "routes": [
      {
       "src": "/.*",
       "methods": ["GET", "POST", "OPTIONS"],
       "headers": { "Access-Control-Max-Age": "1000", "Access-Control-Allow-Methods": "GET, HEAD, PUT, PATCH, POST, DELETE, OPTIONS", "Access-Control-Allow-Origin": "*", "Accept": "text/plain", "Content-Type": "text/plain", "Access-Control-Allow-Headers": "sessionId, Content-Type, API-Key, API-Secret, Access-Control-Allow-Headers", "Access-Control-Expose-Headers": "sessionId", "Access-Control-Allow-Credentials": "true" },
       "continue": true
      },
      { "src": "/user/login", "methods": ["POST"], "dest": "index.js" }
    ]
  }
  </code></pre>
  
  <p>Even added statusCode 200 to all my responses, but without any success. Removing the Npm-cors-package won't change anything, but removing the Now.json totally destroys stuff, and I get <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin" rel="noreferrer">this error, from MDN</a> even though I have it specified in my <code>app.use(cors())</code>.</p>
  
  <p>Not really sure what to do, have been struggeling with this forever. No problem with cURL or other hosts where I can use backend proxy.</p>