From 11f91de16bac490de1d97b4e369c7624e77523fd Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 7 Jun 2019 22:33:28 +0100 Subject: [PATCH] Fixed the reverse proxy --- src/Ombi/ClientApp/src/app/app.module.ts | 13 ++--- src/Ombi/ClientApp/src/index.html | 74 ++++++++++++------------ 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts index 1526e0295..e06740d9a 100644 --- a/src/Ombi/ClientApp/src/app/app.module.ts +++ b/src/Ombi/ClientApp/src/app/app.module.ts @@ -83,9 +83,9 @@ const routes: Routes = [ // AoT requires an exported function for factories export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) { // const base = getBaseLocation(); - const base = platformLocation.getBaseHrefFromDOM(); + const base = '/' + (window.location.pathname.split('/')[1] || '') const version = Math.floor(Math.random() * 999999999); - if (base.length > 1) { + if (base !== null && base.length > 1) { return new TranslateHttpLoader(http, `${base}/translations/`, `.json?v=${version}`); } return new TranslateHttpLoader(http, "/translations/", `.json?v=${version}`); @@ -181,11 +181,10 @@ export function JwtTokenGetter() { MessageService, StorageService, SignalRNotificationService, - { provide: APP_BASE_HREF, useValue: window['_app_base'] || '/' } - // { - // provide: APP_BASE_HREF, - // useFactory: getBaseLocation - // } + { + provide: APP_BASE_HREF, + useValue: '/' + (window.location.pathname.split('/')[1] || '') + } ], bootstrap: [AppComponent], }) diff --git a/src/Ombi/ClientApp/src/index.html b/src/Ombi/ClientApp/src/index.html index 8cca37e00..679997c40 100644 --- a/src/Ombi/ClientApp/src/index.html +++ b/src/Ombi/ClientApp/src/index.html @@ -5,43 +5,43 @@