My code in coffeescript :
resource = $resource GlobalService.apiRoot + "stuffs", {},
get:
method: "GET"
headers:
"Accept": "application/stuffs;version=3"
"Authorization": 'Token token="' + $.cookie('token') + '"'
My code in javascript :
var resource;
resource = $resource(GlobalService.apiRoot + "stuffs", {}, {
get: {
method: "GET",
headers: {
"Accept": "application/stuffs;version=3",
"Authorization": 'Token token="' + $.cookie('token') + '"'
}
}
});
Then when I do..
resource.get ->
It doesn't send out those specified headers, and effectually fails the CORS authorization.
Any recommendations?
Looks like that headers setting is only available in the latest "unstable" release of Angular. If you use this, be sure to upgrade both angular.js and angular.resource.js to 1.1.2 (current unstable release).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With