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

Cannot make the request from the other domain. #13

Open
jamesweb1 opened this issue May 25, 2016 · 1 comment
Open

Cannot make the request from the other domain. #13

jamesweb1 opened this issue May 25, 2016 · 1 comment

Comments

@jamesweb1
Copy link

I have the other php server and want to make the http get to this waffle lua server. But it always displays the following error:
XMLHttpRequest cannot load http://[LUA SERVER]/query?q=hi. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://[PHP SERVER]' is therefore not allowed access. The response had HTTP status code 502.

How to make the lua support the Access-Control-Allow-Origin?

@benglard
Copy link
Owner

I believe you just have to set a few headers which you can do with res.header. See this webpage for more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

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