title: flask redirect "XMLHttpRequest cannot load..." error localhost
body: <p>Running flask locally, trying to call:</p>
  
  <pre><code>@app.route('/foo_route', methods=['POST'])
  @cross_origin(origin='*')
  def foo():
      return redirect("https://www.google.com/")
  </code></pre>
  
  <p>And I get the following error:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="https://www.google.com/" rel="nofollow">https://www.google.com/</a>. No
    'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin '<a href="http://127.0.0.1:5000" rel="nofollow">http://127.0.0.1:5000</a>' is therefore not allowed
    access</p>
  </blockquote>
  
  <p>I tried to use CORS as such:</p>
  
  <pre><code>app = Flask(__name__)
  CORS(app)
  </code></pre>
  
  <p>along with the @cross_origin() on my route. What is going wrong here? I was reading this may be a chrome bug when running locally?
  .</p>