Answer the question
In order to leave comments, you need to log in
Ember.js: how to correctly send a crossdomain request via RESTAdapter?
There is a RESTAdapter and a controller that accesses the adapter:
export default Ember.Controller.extend({
actions: {
auth() {
var a = this.store.adapterFor('auth');
var hash = this.getProperties('login', 'password');
a.ajax('https://192.168.18.134/rest/auth', 'GET', hash);
}
}
});
export default RESTAdapter.extend({
corsWithCredentials: true,
headers: {
'Access-Control-Allow-Origin': '*'
}
});
Запрос из постороннего источника заблокирован: Политика одного источника запрещает чтение удаленного ресурса на https://192.168.18.134/rest/auth (Причина: отсутствует токен 'access-control-allow-origin' в заголовке CORS 'Access-Control-Allow-Headers' из канала CORS preflight).
Error: Ember Data Request GET https://192.168.18.134/rest/auth returned a 0
Payload (Empty Content-Type)
Answer the question
In order to leave comments, you need to log in
Strange, but the headline that I spied on the Internet interfered with: I
removed it and the problems were gone.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question