Skip to content
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

Cors Origin * does not work #5585

Closed
2 of 4 tasks
gsingh-ds opened this issue Jun 19, 2023 · 4 comments
Closed
2 of 4 tasks

Cors Origin * does not work #5585

gsingh-ds opened this issue Jun 19, 2023 · 4 comments

Comments

@gsingh-ds
Copy link

gsingh-ds commented Jun 19, 2023

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

While setting the cors origin to "*" it still return the allowed origin as the host domain.

To Reproduce Steps to reproduce the behavior:

  1. You can see the cors options are set under serve in .meshrc.yml
  2. When you make a request in graphqlmesh you can see the response headers.
    Sandbox: Link
@ardatan
Copy link
Owner

ardatan commented Jun 19, 2023

Because * is not a valid value for that header. So it returns the domain you sent if "*" is set to make the preflight request passed.
There is no bug. It is the expected behavior

@ardatan ardatan closed this as completed Jun 19, 2023
@gsingh-ds
Copy link
Author

gsingh-ds commented Jun 19, 2023

How can I allow all origins? @ardatan

@ardatan
Copy link
Owner

ardatan commented Jun 19, 2023

"*" already does that. If you send a request from a different origin, it will send that origin in the header. This is done for security purposes.

@gsingh-ds
Copy link
Author

gsingh-ds commented Jun 19, 2023

With "*" I am getting Cors error, not sure what's going wrong. When I try to make request even from localhost, no allowed-origin header is present in response headers, @ardatan
Note: Started happening after the update.

This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants