ExtJS: Cross domain issue. CORS parameter it is

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


ExtJS: Cross domain issue. CORS parameter it is



Here is example code:


launch: function () {
Ext.Ajax.request({
url: 'http://domain:8090/mailSender/getList',
method: 'GET',
cors: true,
crossDomain: true,
useDefaultXhrHeader: true,
headers: {
'Access-Control-Allow-Origin': '*',
'access-control-allow-origin': '*'
},
success: function () {
alert('success');
},
failure: function () {
alert('failure');
}
});
}



I get cross domain error in developer console, what is problem in my code?





Please post outputs and make sure people can reproduce error
– P i
Jul 20 at 15:40





Is your server cors enabled
– Snehal Dangroshiya
Jul 20 at 16:54







I run the server with the command - sencha app watch. What server uses i don't know. With a similar problem i came cross with angular
– Aleksandr Zorin
Jul 20 at 17:07







sorry for the confusion, what I mean to be the server is domain:8090. when you send the response you have to set some cors related headers and it would be nice to share error message which you currently facing
– Snehal Dangroshiya
Jul 21 at 1:52







I get in chrome console is "Cross-domain error" the rest of the error in the Russian language. And I pointed in the headers of the request is 'Access-Control-Allow-Origin': '*'
– Aleksandr Zorin
Jul 21 at 17:22




1 Answer
1



I find out the cause. It's necessary, on server-side allow a cross-domain request.
Become application sends options request and in response from the server receives headers (i suppose it's Access-Control-Allow-Origin) which allow application sends to get a request if headers equal request's origin






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

How to scale/resize CVPixelBufferRef in objective C, iOS