GithubHelp home page GithubHelp logo

Comments (3)

javierbrea avatar javierbrea commented on June 11, 2024 1

Hi @kariem,

The server automatically handle the OPTIONS method because it is usually used for front-end development, and these requests are automatically done by the browsers, so I thought it would be useful to not have to add those routes manually always. But you're right, in some scenarios it may be desirable to disable this behaviour and handle them manually.

Another problem is that there is no mention in the documentation about it, so I will try to publish a new version as soon as possible including an option to disable the built-in CORS middleware, and mention it in the docs.

For the moment, as a workaround, if you are modifying the code by yourself, you could also disable the CORS middleware removing the line this._express.use(middlewares.enableCors); in the src/server/Server.js file. But I hope to have a new release with this fix this week.

Thanks for your feedback! 🙂

from core.

javierbrea avatar javierbrea commented on June 11, 2024 1

Hi again @kariem!

The version 2.1.0 is already released, and the docs were also updated. Now it supports OPTIONS, HEAD and TRACE methods, and it has two new options allowing to disable both CORS headers and CORS pre-flight responses separately. You can read the "how to use the OPTIONS method" section in the documentation for further info.

I hope it might help,
Thanks again for your feedback! 🙂

from core.

kariem avatar kariem commented on June 11, 2024 1

Hi @javierbrea,

Thank you very much for the quick update!

Just tested 2.1.0 with the adapted configuration and it works well.

Thank you!

from core.

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.