Giter VIP home page Giter VIP logo

Comments (6)

lwcolton avatar lwcolton commented on September 26, 2024

from falcon-cors.

StevenPG avatar StevenPG commented on September 26, 2024

Thanks @lwcolton , I've recreated the issue with other services as well.

from falcon-cors.

lwcolton avatar lwcolton commented on September 26, 2024

from falcon-cors.

StevenPG avatar StevenPG commented on September 26, 2024

Sorry for the delay, with CORS enabled, everything works for Postman, but fails from cURL and my ReactJS application. With Falcon_cors implemented, the same thing occurs. The failure is "Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response."

The other one is the typical CORS one, URL not allowed due to origin.

Another team member ran their changes through our full CI/CD suite so I'm reverting some stuff in a test environment. It's always working from Postman and a web browser though.

Edit: It is working fine through cURL and Postman now that everything is back to how it was with falcon_cors setup. Still getting Content Type issue and origin errors from ReactJs App.

from falcon-cors.

StevenPG avatar StevenPG commented on September 26, 2024

Ok I have to apologize, I think I misread your readthedocs page...

I've gotten it working, and I had to include the single whitelisted URL.

This is the winning configuration:
cors = CORS(allow_origins_list=['http://localhost:3000'])
api = falcon.API(middleware=[cors.middleware])
public_cors = CORS(allow_all_origins=True, allow_all_methods=True, allow_all_headers=True)

When I remove localhost:3000 (which isn't where I'm hitting it from), then Content-Type issue appears and if I try to specify any specific headers, methods, or origins I seem to run into problems.

I even tried copying the request methods and headers into the response.

Thank you for building this library, sorry to waste some time!!

from falcon-cors.

lwcolton avatar lwcolton commented on September 26, 2024

from falcon-cors.

Related Issues (13)

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.