@dmendes wrote:
I am having some problems sending costum request headers to the server
I wrote the following
$httpProvider.interceptors.push('httpRequestInterceptor');
.factory('httpRequestInterceptor', ['$rootScope', function ($rootScope) {
return {
request: function ($config) {
$config.headers['x-auth-ticket'] = "test";
return $config;
}
};
}])However when I do a request i get
Request header field x-auth-ticket is not allowed by Access-Control-Allow-Headers in preflight response.
and the Header istead of being there is added in
Access-Control-Request-Headers:accept, x-auth-ticket
so my header
x-auth-ticket: test
is not in the Request headers. Do i have to configure something else in ionic? Or could it be something on the server side?
Posts: 2
Participants: 2