Code Monkey home page Code Monkey logo

Comments (7)

mschae avatar mschae commented on July 20, 2024

Hey @decentname,

regexes are not supported as part of lists. Right now we offer either a list or a regex.

In you case this should work:

plug CORSPlug, origin: ~r/http:\/\(.*)?localhost:3000/

from cors_plug.

himanshu0128 avatar himanshu0128 commented on July 20, 2024

Okay. Thanks! This will do.

from cors_plug.

mschae avatar mschae commented on July 20, 2024

Looks like your regex above had this bug. You are escaping the first paren. I just copy and pasted it.

This one works: ~r/http:\/\/(.*)?localhost:3000/

Pro-tip: You can delimit with other chars: ~r[http://(.*)?localhost:3000] (I find that a little nicer to read).

from cors_plug.

himanshu0128 avatar himanshu0128 commented on July 20, 2024

Yep. I fixed it already so did not bother asking it . Thanks for the pro tip ! 👍

from cors_plug.

justgigio avatar justgigio commented on July 20, 2024

Hi, any plans to support list of regexes? I need to allow some different variations of different domains, so, by now i have to choose between a big list or a big regex... T_T
I think something like that would be ideal for this problem:

plug CORSPlug,
    origin: [ ~r/https?\:\/\/(www\.)?firstdomain\.com\.br/,
              ~r/https?\:\/\/(www\.)?sub\.seconddomain\.com\.br/,
              ~r/https?\:\/\/(www\.)?sub2\.thirddomain\.com\.br/ ]

from cors_plug.

mschae avatar mschae commented on July 20, 2024

@giovanecosta I'm afraid not. Since you can express every list of regexes as a regex itself I think it'd be unnecessary bloat to allow lists of regexes. Hope that makes sense

from cors_plug.

justgigio avatar justgigio commented on July 20, 2024

Oh, i see, it do make sense. Maybe i can try to make my big regex less ugly then 😁 . Thank you for answer.

from cors_plug.

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.