-
Notifications
You must be signed in to change notification settings - Fork 0
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
Cannot serve requests to other microservices #7
Comments
Which app.ts? Will read further into this to consider the security implications of allowing all domains. |
|
What about using this https://www.npmjs.com/package/cors ? |
It seems we should restrict the allowed origin to the front end origin (e.g. localhost:15300) and the allowed methods to POST, GET, PATCH, DELETE, OPTIONS - will look into doing this with the cors package. |
Would be good, we should probably base the origin off a configuration so there are minimal code changes when deploying into production. Cors package looks like a good option to make things clear and easy |
Potential solution in new gateway PR |
Describe the bug
When other microservices make requests to the gateway endpoints they fail the CORS preflight checks due to the wrong headers being applied to the response.
To Reproduce
docker-compose up
theuems-hub
project and load the/events
endpoint of the frontend. It will showLoading...
permenantly and the console will display cors preflight errors.Expected behavior
Events should be loaded successfully from the gateway
Desktop (please complete the following information):
Notes
Adding the following to
app.ts
fixes the problem temporarily but allows it to be requested from all domains (not sure if that is what we want)The text was updated successfully, but these errors were encountered: