Git Product home page Git Product logo

Comments (3)

erdillon avatar erdillon commented on July 17, 2024 6

ARggghhh!!! my bad. There was an extra '/' trailing in the URL from my app, and not in my 'direct' browser attempt in #1 above.

Thanks much for your help. Sorry for the false alert...
Eric

from flask-cors.

corydolphin avatar corydolphin commented on July 17, 2024

Hi @erdillon sorry to hear you are having trouble, I want to do my best to help you get to the bottom of this.

  1. As you probably know, 404 is a not found exception. Have you double checked the URL you are making a request to? Can you see the log of requests in the flask debugger?
  2. If a 404 is being triggered, (i.e. if you have some sort of ORM which automatically returns a 404 if a particular object is not found), Flask-Cors currently will not add CORS headers to the response, as it is outside the scope of the view function. The way to fix this is wrap the 404 handler with the decorator.

from flask-cors.

erdillon avatar erdillon commented on July 17, 2024
  1. Yes, the URL is correct. A direct hit from browser (no cross-domain) does work.
  2. Not sure I understand. I thought Flask-Cors was adding the OPTIONS method to a route where the decorator was places. In fact, please note that another route using 'POST' does work fine. I do see the OPTIONS resp go 200, followed by the actual POST.

from flask-cors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.