Code Monkey home page Code Monkey logo

Comments (3)

lewisloofis avatar lewisloofis commented on June 10, 2024

Hi, how's this issue going? our app use unleash proxy and meet CORS error, so I think we need this

from unleash-proxy.

ivarconr avatar ivarconr commented on June 10, 2024

We should add a few options to control the essential parts, like providing a list of origins and maxAge
https://expressjs.com/en/resources/middleware/cors.html

Any takers?

from unleash-proxy.

nya1 avatar nya1 commented on June 10, 2024

Hello, I'd be interested in helping with this, the following new options would be fine?

Option Environment Variable Default value Required Description
cors n/a n/a no Pass custom options for CORS module, see cors module
cors.origin CORS_ORIGIN * no Origin URL or list of URLs to whitelist for CORS
cors.maxAge CORS_MAX_AGE 172800 no Maximum number of seconds to cache CORS results

In this way the user can optionally provide a full custom cors object (via code) and completely customize the CORS behavior, or for a simpler use case can just set the CORS_ORIGIN / CORS_MAX_AGE env variable (e.g. prebuilt docker image)

from unleash-proxy.

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.