diff --git a/lib/core/viewer/components/txtViewer.component.ts b/lib/core/viewer/components/txtViewer.component.ts index e344360e39..23f4331442 100644 --- a/lib/core/viewer/components/txtViewer.component.ts +++ b/lib/core/viewer/components/txtViewer.component.ts @@ -18,6 +18,7 @@ import { HttpClient } from '@angular/common/http'; import { Component, Input, OnChanges, ViewEncapsulation } from '@angular/core'; import { SimpleChanges } from '@angular/core'; +import { AppConfigService } from './../../app-config/app-config.service'; @Component({ selector: 'adf-txt-viewer', @@ -36,7 +37,7 @@ export class TxtViewerComponent implements OnChanges { content: string | ArrayBuffer; - constructor(private http: HttpClient) { + constructor(private http: HttpClient, private appConfigService: AppConfigService) { } ngOnChanges(changes: SimpleChanges): Promise { @@ -57,8 +58,10 @@ export class TxtViewerComponent implements OnChanges { } private getUrlContent(url: string): Promise { + let withCredentialsMode = this.appConfigService.get('auth.withCredentials', false); + return new Promise((resolve, reject) => { - this.http.get(url, { responseType: 'text' }).subscribe((res) => { + this.http.get(url, { responseType: 'text', withCredentials: withCredentialsMode }).subscribe((res) => { this.content = res; resolve(); }, (event) => {