-
Notifications
You must be signed in to change notification settings - Fork 173
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
Access-Control-Allow-Origin issue #103
Comments
change apiai.js this worked me |
not sure using apps like https://cors-anywhere.herokuapp.com/ good solution for this issue. |
See here: you can install cors-anywhere on a server you own. |
I am also getting the same error. Plugin worked fine 3 days back but now this CORS issue has started to pop up. @fdavies93 - can you please tell how to include the cors anywhere in my nodejs code. THis is my node code:
|
Maybe a spot of confusion here -- CORS anywhere is a proxy server which you'd have to run as a separate app, then route requests to api.api.ai through. Not sure about your setup but in a containerised environment this isn't too bad. I did this by hunting down the URL variables in dialogflow-javascript-client, changing them to point at [proxy url]/https://api.api.ai/, then rebuilding the library for my apps. A bit of a pain but worked and was a quick fix until Google sort it properly. I am curious why you're suddenly having CORS issues though, as your setup doesn't seem to touch the Dialogflow servers. Possibly you're not handling the OPTIONS call which Chrome (and maybe other browsers) sends before handling POST responses? |
"Access to XMLHttpRequest at 'https://api.api.ai/v1/query?v=20150910' from origin 'https://.......com' has been blocked by CORS policy: Request header field x-usertoken is not allowed by Access-Control-Allow-Headers in preflight response." I am getting this error, I allowed cord although |
Failed to load https://api.api.ai/v1/query?v=20150910: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.
Still having same issue please respond as fast as possible.
if anybody have solutions please ping me,
thank you
The text was updated successfully, but these errors were encountered: