Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default RESTAdapter.extend({
headers: computed(function() {
return {
'API_KEY': get(document.cookie.match(/apiKey\=([^;]*)/), '1'),
'ANOTHER_HEADER': 'Some header value'
};
}).volatile()
});
@class RESTAdapter @constructor @extends Adapter @uses BuildURLMixin */ const RESTAdapter = Adapter.extend(BuildURLMixin, { defaultSerializer: '-rest',
_defaultContentType: 'application/json; charset=utf-8',
fastboot: computed({ // Avoid computed property override deprecation in fastboot as suggested by: // https://deprecations.emberjs.com/v3.x/#toc_computed-property-override get() { if (this._fastboot) { return this._fastboot; } return (this._fastboot = getOwner(this).lookup('service:fastboot')); }, set(key, value) { return (this._fastboot = value); },