mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Fix circular dependecies issue importing AppConfigService outside the api entrypoint dir
This commit is contained in:
@@ -42,7 +42,6 @@ import { AlfrescoApiParamEncoder } from './alfresco-api/alfresco-api.param-encod
|
|||||||
import { AlfrescoApiResponseError } from './alfresco-api/alfresco-api.response-error';
|
import { AlfrescoApiResponseError } from './alfresco-api/alfresco-api.response-error';
|
||||||
import { Constructor } from './types';
|
import { Constructor } from './types';
|
||||||
import { RequestOptions, SecurityOptions } from './interfaces';
|
import { RequestOptions, SecurityOptions } from './interfaces';
|
||||||
import { AppConfigService, AppConfigValues } from '../../../src/lib/app-config/app-config.service';
|
|
||||||
import ee, { Emitter } from 'event-emitter';
|
import ee, { Emitter } from 'event-emitter';
|
||||||
|
|
||||||
export interface Emitters {
|
export interface Emitters {
|
||||||
@@ -77,7 +76,7 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
|||||||
defaultHeaders: {}
|
defaultHeaders: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(private httpClient: HttpClient, private appConfig: AppConfigService) {
|
constructor(private httpClient: HttpClient) {
|
||||||
ee(this);
|
ee(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,11 +270,8 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
|||||||
...((options.contentType) && {'Content-Type': options.contentType})
|
...((options.contentType) && {'Content-Type': options.contentType})
|
||||||
};
|
};
|
||||||
|
|
||||||
const disableCsrf = this.appConfig.get<boolean>(AppConfigValues.DISABLECSRF);
|
if (!this.disableCsrf) {
|
||||||
|
|
||||||
if (!disableCsrf) {
|
|
||||||
this.setCsrfToken(optionsHeaders);
|
this.setCsrfToken(optionsHeaders);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HttpHeaders(optionsHeaders);
|
return new HttpHeaders(optionsHeaders);
|
||||||
|
Reference in New Issue
Block a user