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

Access-Control-Allow-Origin issue #102

Open
ghost opened this issue Oct 12, 2018 · 18 comments
Open

Access-Control-Allow-Origin issue #102

ghost opened this issue Oct 12, 2018 · 18 comments

Comments

@ghost
Copy link

ghost commented Oct 12, 2018

Failed to load https://api.api.ai/v1/query?v=20150910: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

@ghost
Copy link
Author

ghost commented Oct 12, 2018

Is there anyone has the same issue can help me out

@ricas07
Copy link

ricas07 commented Oct 12, 2018

I'm having a similar issue and additional warning,
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api.api.ai/v1/query?v=20150910 with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Any update would be appreciated.

@ghost
Copy link
Author

ghost commented Oct 13, 2018

change apiai.js
this.uri = this.apiAiClient.getApiBaseUrl() + "query?v=" + this.apiAiClient.getApiVersion();
to
this.uri = "https://cors-anywhere.herokuapp.com/" + this.apiAiClient.getApiBaseUrl() + "query?v=" + this.apiAiClient.getApiVersion();

@latheesh08
Copy link

@zyzarvin1987 does your solution works, if sure can u please mention where should i need to change it.because i didn't see the above lines in apiai.js

Thanks.

@ricas07
Copy link

ricas07 commented Oct 13, 2018

@zyzarvin1987 I've confirmed this workaround enables you to get responses from dialogFlow, but you have to send your request to a third party, including the Authorization header which contains your token. The third party then forwards the response to you.
This is a pretty big security issue, I would not recommend this as a solution.
Any further update would be appreciated.

@fdavies93
Copy link

Just as an FYI, this is a server issue on Google's side. Hopefully they will fix it ASAP.

You can install cors-anywhere as a module on a server you control if you need the proxy capabilities but don't want to send your data to a third party: (https://www.npmjs.com/package/cors-anywhere)

@bgbdsl
Copy link

bgbdsl commented Oct 15, 2018

My app Still not available for connect to dialoglflow.

it works fine 3 days ago,

what happend

"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:9008' is therefore not allowed access."

"Uncaught (in promise) ApiAiRequestError
at new ApiAiBaseError (webpack-internal:///5:5:22)
at new ApiAiRequestError (webpack-internal:///5:20:9)
at TextRequest.handleError (webpack-internal:///6:32:21)"

"Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api.api.ai/v1/query?v=20150910 with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details."

@ATakaSKY
Copy link

@bgbdsl Even I have the same issue. Can see the logs working for 3 days back. Today it has started giving CORS. Any luck yet?

@berithpy
Copy link

It seems like it fixed itself

@ghost
Copy link
Author

ghost commented Oct 15, 2018 via email

@parkkichul
Copy link

today, this issue happened again.

@parkkichul
Copy link

this.uri = "https://cors-anywhere.herokuapp.com/" + this.apiAiClient.getApiBaseUrl() + "query?v=" + this.apiAiClient.getApiVersion();

this solution is not works, anybody, Is there anyone has the same issue can help me out

@latheesh08
Copy link

@parkkichul got the same issue . Last time it resolved but now it's not working don't know why have to wait for the fix.. if anyone found the solution please share . thank you in advance.

@parkkichul
Copy link

https://cors-anywhere.herokuapp.com/https://api.api.ai/v1/query?v=20150910,

when I using cors-anywhere.herokuapp.com, it returned,

"Missing required request header. Must specify one of: origin,x-requested-with"

anybody help me out

@ghost
Copy link
Author

ghost commented Mar 8, 2019

you should update your bot to v2 api, so you will not receive this issue any more

@latheesh08
Copy link

@zyzarvin1987 is this module support v2. If so, tell me the procedure to migrate or any other module you know that support dialogflow v2 please ping me. thank you in advance

@Tasininet
Copy link

Hi, I am running into a similar issue attempting to use dialogflow v2, I am new to using HTTP, what sort of information would be useful for debugging this?

@eisenek
Copy link

eisenek commented Aug 13, 2019 via email

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

9 participants