Fixed when not using reverse proxy !wip

This commit is contained in:
tidusjar 2017-09-29 23:32:35 +01:00
commit 1a61f0dbe6

View file

@ -10,8 +10,9 @@ export class ServiceHelpers {
protected headers: Headers;
constructor(protected http: Http, protected url: string, protected platformLocation: PlatformLocation) {
if (this.url.length > 1) {
this.url = platformLocation.getBaseHrefFromDOM() + this.url;
const base = platformLocation.getBaseHrefFromDOM();
if (base.length > 1) {
this.url = base + this.url;
}
this.headers = new Headers();
this.headers.append("Content-Type", "application/json; charset=utf-8");
@ -37,8 +38,9 @@ export class ServiceAuthHelpers {
protected headers: Headers;
constructor(protected http: AuthHttp, protected url: string, protected platformLocation: PlatformLocation) {
if (this.url.length > 1) {
this.url = platformLocation.getBaseHrefFromDOM() + this.url;
const base = platformLocation.getBaseHrefFromDOM();
if (base.length > 1) {
this.url = base + this.url;
}
this.headers = new Headers();
this.headers.append("Content-Type", "application/json; charset=utf-8");