-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex in CORS? #2556
Comments
Unfortunately, doesn't look like this is possible: https://stackoverflow.com/questions/18439340/using-a-regular-expression-with-cors |
The SO thread gives a pretty interesting solution. Plus, since Medusa is based on Express, there must be a package which handles this well. Also, even * (ANY) would work for testing, but that doesn't seem to work either... |
@srindom @olivermrbl I ve built this #1935 which i tested locally and I think some community members tested the pr for their needs as well. But it is not a workaround it is a proper feature of the cors package, i ve linked the implementation in the description 😅 |
Lgtm. When can we get this bros |
My apologies for the wording here @adrien2p. Did not mean to indicate that it was not the right implementation! 😅 @SaadBazaz Will be included in the next release coming out later this week or early next 👍 |
Is your feature request related to a problem? Please describe.
I'm trying to deploy the storefront on Vercel, with the backend hosted on a custom server.
Since, during the build process, the frontend makes requests for static/server side, there are CORS errors which cause it to fail.
I want to temporarily set the CORS to any (i.e. *). Doesn't work.
Describe the solution you'd like
Regex-based CORS. e.g.:
*.vercel.app (so that I can safely deploy to Vercel for testing).
Describe alternatives you've considered
Listing each and every possible domain in Vercel, but that isn't a good solution.
The text was updated successfully, but these errors were encountered: