Back to General discussions forum
Привет, Родион :)
For the task #176 I was trying to use JavaScript (don't ask me why JS :) code like this:
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
}
};
xhttp.open("POST", "https://open-abbey.appspot.com/interactive/say-100", true);
xhttp.send("token: TOKEN");
But, because of this error, I wasn't able to do this:
Access to XMLHttpRequest at 'https://open-abbey.appspot.com/interactive/say-100' from origin 'https://www.codeabbey.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
So, my question is :) Could you please set the value of Access-Control-Allow-Origin to the proper meaning :)
If you put that url in a web browser, does it work? It does for me.
I can also access the page from a command prompt using
curl https://open-abbey.appspot.com/interactive/say-100
Dmitry, Hi!
As I understand you are trying to run your JS in another web-page and your browser restricts you from accessing different domain?
We can add the header, but I'm not sure we really want it... Appengine server have certain limits and probably won't survive if some people will eventually carelessly publish page bombing it with hundred requests per second... I'm afraid we've lost our previous server due to something like this... :)
Perhaps some of the following options may work for your purposes:
google-chrome --disable-web-security
:)Could any of this help?
Hi, Admin! Thank you! I'll try and report about results :)
This addon for Chrome browser allows me to do what I want: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi/related?hl=en
Thank you for your help!