title: Access to XMLHttpRequest at URL from origin URL has been blocked by CORS policy
body: <p>I am trying to deal with CORS for my frontend. On my local host (development environment) the given cors works fine. but when I deploy application to <code>heroku</code> it gives the given error.  </p>
  
  <p><code>Access to XMLHttpRequest at 'myHerokuURL' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
  </code></p>
  
  <p>Here is the CORS that I am using. </p>
  
  <pre><code>app.use(function (req, res, next) {
      res.setHeader('Access-Control-Allow-Origin', '*');
      res.setHeader('Access-Control-Allow-Methods', '*');
      res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With, Authorization, x-auth-token, content-type');
      res.setHeader('Access-Control-Allow-Credentials', false);
      next();
    }); 
  </code></pre>