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 policy #17

Open
jetgriffin opened this issue Oct 18, 2022 · 0 comments
Open

CORS policy #17

jetgriffin opened this issue Oct 18, 2022 · 0 comments

Comments

@jetgriffin
Copy link
Contributor

jetgriffin commented Oct 18, 2022

Captura de pantalla de 2022-10-17 20-50-11
This error occurs because the Access-Control-Allow-Origin: * header is not present in the new Response() object. In the dev environment we need the headers so the client has not problems in reaching the requested resources. Fix: to add a new property private headers: Headers; in Melonpan, which contains all set headers, in order to pass them as a param in all the new Response() objects. So now we just need to call melonpan.cors() to set all the default headers, which are:

[
  ["Access-Control-Allow-Origin", "*"]
  ["Access-Control-Allow-Methods", "POST, GET, OPTIONS"]
  ["Access-Control-Allow-Headers", "X-PINGOTHER, Content-Type"]
  ["Access-Control-Max-Age", "86400"]
]

I shall make a pull request to fix it.

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

1 participant